Hi,
I finally succeeded to have the same result like in this picture ("wish.png")
I'm still using Wings 3D v1.5.4. I put some objects, a torus a sphere and a cone on the [X-Z] ground. For me, the up axis is [Y].
Test scene : ("test_normal.wings")
I've taken the shaders : vextex_colors.vs and vertex_colors.fs and modified them just a little to have this result (see "result.png")
Here is the shaders :
Vertex Shader : vertex_color.vs
Fragment shader : vertex_color.fs
If you want flip the colors in X or Z axis, you can just trick the boolean to have the desired result.
I'll share that into the Auto UV shaders forum too.
Regards,
I finally succeeded to have the same result like in this picture ("wish.png")
I'm still using Wings 3D v1.5.4. I put some objects, a torus a sphere and a cone on the [X-Z] ground. For me, the up axis is [Y].
Test scene : ("test_normal.wings")
I've taken the shaders : vextex_colors.vs and vertex_colors.fs and modified them just a little to have this result (see "result.png")
Here is the shaders :
Vertex Shader : vertex_color.vs
Code:
varying vec3 VertexColor;
uniform int Flag;
void main()
{
VertexColor = gl_Normal;
gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
}
Fragment shader : vertex_color.fs
Code:
varying vec3 VertexColor;
void main()
{
bool flipX = false;
bool flipZ = true;
vec4 color = vec4((1.0 + VertexColor) / 2.0, 1.0);
gl_FragColor.r = flipX ? 1.0 - color.r : color.r;
gl_FragColor.g = flipZ ? 1.0 - color.b : color.b;
gl_FragColor.b = color.g;
}
If you want flip the colors in X or Z axis, you can just trick the boolean to have the desired result.
I'll share that into the Auto UV shaders forum too.
Regards,