Hello. I am just starting to look at HLSL and Leadwerks materials. My understanding is very rudimentary.
I am trying to get a diffuse texture to "tile" (repeat, etc) on the surfaces of a cube.
In rendermonkey I was able to achieve that with the following .vert and .frag files.
.frag
uniform sampler2D baseMap;
varying vec2 Texcoord;
vec2 mytexcoord = vec2(16.0,16.0);
void main( void )
{
gl_FragColor = texture2D( baseMap , Texcoord * mytexcoord );
}
.vert
varying vec2 Texcoord;
void main( void )
{
gl_Position = ftransform();
Texcoord = gl_MultiTexCoord0.xy;
}
It seems as if multiplying the gl_MultiTexCoord0.xy via:
gl_FragColor = texture2D( baseMap , Texcoord * mytexcoord );
is the way to make it tile over a surface.
I am assuming that if I multiply the Texcoord variable in leadwerks "mesh.frag", I will get the tiling effect I am looking for. Using mesh.vert and mesh.frag as includes, how do I manage to do that in leadwerks?
Thanks!