Jump to content
  • Advertisement
Sign in to follow this  

see through meshes problem when using vertex shader

This topic is 4416 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!