Sign in to follow this  

see through meshes problem when using vertex shader

This topic is 4110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm new to vertex shaders. I have written some code that moves vertices based on a constant set by my application. I am moving the vertices (by small distances) after it is multiplied by the view-projection matrix. I am only updatig the <x,y,z> coordinates for every vertex. The effect appears fine but some surfaces of mesh, that should have been hidden behind some other mesh are visible. Could it be because I am not changing the w component? What should "w" be(as a function of x, y, z?), if I am changing it after matrix multiplication? I tried setting w to some fixed constants (1.0, 0.0 etc) for all vertices, but in both cases, all meshes disappear.. The glitch appears as though part of the mesh behind has its Z-buffer value smaller than the one in front. This doesn't happen with all the surfaces and all meshes. Can it be a mesh specific problem? I am writing the shader code in assembly (vs_3_0). Has anyone faced a similar problem? Any suggestions? Thanks (Sorry, but I can't post the entire shader code on a forum..)

Share this post


Link to post
Share on other sites

This topic is 4110 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this