i'm using the Reflection Renderpass and shader from this thread:
http://www.jmonkeyengine.com/jmeforum/index.php?topic=7405.0
I want the 1st Texture (the floor) to be scaled and the current shader does not take the scale factor (set by Texure.setScale(50,50,50)) into account.
How can this be fixed?
vertex shader:
varying vec4 viewCoords;
uniform sampler2D reflection;
uniform sampler2D tex;
void main()
{
vec4 projCoord = viewCoords / viewCoords.q;
projCoord = (projCoord + 1.0) * 0.5;
projCoord.x = 1.0 - projCoord.x;
vec4 reflectionColor = 0.5 * (texture2D(reflection, projCoord.xy) + texture2D(tex,gl_TexCoord[0].st));
gl_FragColor = reflectionColor;
}
fragment:
varying vec4 viewCoords;
void main()
{
gl_TexCoord[0] = gl_MultiTexCoord0;
//This calculates our current projection coordinates
viewCoords = ftransform();
gl_Position = viewCoords;
}