You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I pulled v2-dev earlier today, as I couldn't get vertex colors working with v1. Now, colors are working, but I can't seem to access normals in my shader.
#version120varyingvec4 frontColor;
varyingvec3 normal;
void main()
{
gl_FragColor= frontColor +vec4(normal, 1.0); // just to test
}
I append gfx.Vec3s to mesh.Normals, and I have one normal per vertex. When I try to add the normal to gl_FragColor, the mesh disappears, but when I only use frontColor, it shows up as usual.
Do you have any idea what's wrong?
The text was updated successfully, but these errors were encountered:
Comment by slimsag Monday Dec 29, 2014 at 20:28 GMT
@oal Thank you for testing v2 and for raising this issue, I really appreciate it.
It looks like the previous issue #11 was incorrectly closed, I apologize for this. It looks like the proper code to support this was never added to the gl2 device backend.
You should be able to (even using v1) use a custom vertex attribute in addition to your shader above:
If you can share your code via e.g. a GitHub repository (even if it's large) I can dig in further if you need more help.
Side note: v2 is still in development and there are some changes that must be made to gfx.Mesh in order to support WebGL -- so beware that v2 isn't stable yet (in case you did not know).
Thanks for your quick response. Using mesh.Attribs works. Yes, I'm aware that v2 isn't stable yet, but my project is still pretty small, so I'm not too worried about breaking changes at the moment. 😄
Issue by oal
Monday Dec 29, 2014 at 19:47 GMT
Originally opened as azul3d-legacy/gfx#87
I pulled v2-dev earlier today, as I couldn't get vertex colors working with v1. Now, colors are working, but I can't seem to access normals in my shader.
Vertex shader:
Fragment shader:
I append gfx.Vec3s to mesh.Normals, and I have one normal per vertex. When I try to add the normal to gl_FragColor, the mesh disappears, but when I only use frontColor, it shows up as usual.
Do you have any idea what's wrong?
The text was updated successfully, but these errors were encountered: