Hi everybody,
If you are interesting to have a shader that show normal like in this picture :

I'll share to you this two files that I've modified from wings 3d 1.5.4 :
vertex_color.vs and vertex_color.fs.
I put some objects, a torus a sphere and a cone on the [X-Z] ground.
Link to the test scene : test_norlmal.wings
For me, the up axis is [Y]. I'm still using Wings 3D v1.5.4.
I've taken this shaders : vextex_colors.vs and vertex_colors.fs and just modified a little to have this result (see attached 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.
Best regards
If you are interesting to have a shader that show normal like in this picture :

I'll share to you this two files that I've modified from wings 3d 1.5.4 :
vertex_color.vs and vertex_color.fs.
I put some objects, a torus a sphere and a cone on the [X-Z] ground.
Link to the test scene : test_norlmal.wings
For me, the up axis is [Y]. I'm still using Wings 3D v1.5.4.
I've taken this shaders : vextex_colors.vs and vertex_colors.fs and just modified a little to have this result (see attached 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.
Best regards