Started on individual room lighting and additional room fixes from un-applied transformations.
This commit is contained in:
@@ -15,34 +15,34 @@ void vertex(){
|
||||
//this sets all the stuff necesary
|
||||
//spawn them in a given radius around the emmitor
|
||||
|
||||
|
||||
|
||||
//set the position to be randomly dispersed in an area
|
||||
float x_modifier = (rand(vec2(TIME,0))*particle_diameter);
|
||||
float z_modifier = (rand(vec2(TIME+1f,0))*particle_diameter);
|
||||
|
||||
|
||||
//centers effect
|
||||
TRANSFORM[3][0] = x_modifier - 0.5f*particle_diameter;
|
||||
TRANSFORM[3][2] = z_modifier- 0.5f*particle_diameter;
|
||||
|
||||
|
||||
|
||||
|
||||
//VELOCITY.y = -rand(vec2(TIME+2f,0));
|
||||
VELOCITY.y = -1f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//apply a changing wind that changes with time with a noticable variation
|
||||
VELOCITY.x = 3f*sin(TIME/4f)*sin(TIME)*rand(vec2(float(INDEX),0f));
|
||||
VELOCITY.z = 3f*cos(TIME/4f)*cos(TIME)*rand(vec2(float(INDEX)+1f,0f));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//gives a consistent rotation that depends on the index
|
||||
float x_rotation = TIME*rand(vec2(float(INDEX),0f));
|
||||
float y_rotation = TIME*rand(vec2(float(INDEX)+1f,0f));
|
||||
float z_rotation = TIME*rand(vec2(float(INDEX)+2f,0f));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//these just rotate the leaf using matrix math
|
||||
//x rotation
|
||||
TRANSFORM[1][1] = cos(x_rotation);
|
||||
@@ -59,5 +59,5 @@ void vertex(){
|
||||
TRANSFORM[1][0] = -sin(z_rotation);
|
||||
TRANSFORM[0][1] = sin(z_rotation);
|
||||
TRANSFORM[1][1] = cos(z_rotation);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user