three.js - Lighting a Particle System in THREEJS/GLSL -


i made particle system buffergeometry in threejs. want particles receive light. is difficult (impossible?) because geometry doesn't have faces light?

i'm working in shader created. created geometry in threejs.

are particles not in world space? in camera space only?

what simple glsl fragment shader equation lighting particles?

it depends on kind of material using particles. if using shadermaterial , write own fragmentshader, have implement lighting in shader code. example, lighten particles close light source, lighten color distance between each particle , light position:

vec3 lightposition = vec3(1.0, 2.0, 3.0); float lightstrength = 0.1;  float distancetolightsource = distance(particleposition, lightposition);  vec4 lightercolor = particlecolor * distancetolightsource * lightstrength; 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -