Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

juhaszt

programming wheel track on terrain surface

This topic is 5983 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

Please help! How to programm wheel tracks on the terrain surface like on this picture: http://www.ejfelkapitany.hu/swine4.jpg Tom

Share this post


Link to post
Share on other sites
Advertisement
Calculate the intersections of the wheels with the ground... then for that point use the surface''s (ground''s) plane to make a square... then use that square for texturing tracks... and voila

that is all

ICQ: 130925152
Email: e.j.folkertsma@student.utwente.nl

Share this post


Link to post
Share on other sites
so if I understand you well:
the wheel track contains lot of small textured squares?
Then you need some tricks I think...
You have to switch off Z buffering in order to be sure that the small textured squares will not be covered by the terrain surface. But if you switch off the Z buffering you have to render this small squares before rendering any other objects on the terrain surface.
Am I right?

Share this post


Link to post
Share on other sites
In OpenGL, you''d have to render them after everything else. Well, not actually everything, just the terrain as the tracks would show through the objects on the terrain. I''ve never done something like that but maybe you can do something tricky with detail textures on the terrain.

Share this post


Link to post
Share on other sites
The DX docs use this exact example as an opportunity to advertise stencil buffering. If your development system supports this, I''d look into it.

Share this post


Link to post
Share on other sites
I thought stencil buffering is something completely different thing! Thanks for the idea, I will check it...

Share this post


Link to post
Share on other sites
In stencil buffering you have basically a flag for each pixel onscreen. If you have tyre-tracks at a pixel, set the flag. Then make a second render-pass and wherever the flag is set, draw on your tracks. The stencil buffer uses bits from the z buffer, i think 1,2,4 or 8. Obviously using 8bits makes the depth buffer a lot less accurate, but here I think you can use a 1 bit stencil buffer - the tracks are either there or not.

Share this post


Link to post
Share on other sites

  • 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!