Give smoke quads random rotation to reduce artifacts from repitition
This commit is contained in:
parent
857f978504
commit
9069277573
@ -4,7 +4,7 @@ uniform sampler2D uSmoke;
|
||||
void main(void)
|
||||
{
|
||||
vec3 normal = 2.0 * texture2D (uNormal, gl_TexCoord[0].st).rgb - 1.0;
|
||||
normal = normalize (normal);
|
||||
normal = normalize (gl_NormalMatrix * normal);
|
||||
|
||||
float lamberFactor = max (dot (gl_LightSource[1].position.xyz, normal), 0.0) ;
|
||||
|
||||
|
@ -308,7 +308,8 @@ public final class FlameRenderer {
|
||||
mvmatrix[1] = mvmatrix[2] = mvmatrix[4] = mvmatrix[6] = mvmatrix[8] = mvmatrix[9] = 0;
|
||||
gl.glLoadMatrixd(mvmatrix, 0);
|
||||
|
||||
//TODO Add a random rotation to prevent artifacts from texture.
|
||||
//Add a random rotation to prevent artifacts from texture.
|
||||
gl.glRotatef(r.nextFloat()*45f, 0,0,1);
|
||||
|
||||
gl.glBegin(GL.GL_TRIANGLE_FAN);
|
||||
float d = radius.f(z) * scale * 2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user