Jump to content
  • Advertisement

Archived

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

honestee

I want to know how to implement this...(screen shot of C&C)

This topic is 5171 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 want to know how to implement this... (this is a screen shot of C&C) let me know a idea (or related link?)...

Share this post


Link to post
Share on other sites
Advertisement
hmm... that's an interesting question. I'd like to know the answer too.

I suppose you could do it something like this:
1) Draw the terrain
2) Draw the building, and draw it into the stencil map, too
3) Draw the bulldozer (using z-buffer to make sure it's hidden by the building)
4) Draw the bulldozer again, but this time: draw it with texturing off, all the vertices a single colour (brown), give it an alpha value, set up the blending so it will tint the building, and set the stencil test so that it only draws where the stencil buffer is set (and turn off z-test, of course)

I don't know if that's the best solution though.

John B

[edited by - JohnBSmall on May 20, 2004 7:41:25 AM]

Share this post


Link to post
Share on other sites
Yep, JohnB is right. Its the same technique as used with shadows. Have a look for some stencil shadow tutorials for shadow methods, and it should be easy to convert to that effect.

Share this post


Link to post
Share on other sites
A simpler method (that doesn''t need stencil buffer shenanigans)
1. Draw terrain/buildings.
2. Draw tank normally.
3. Draw tank with depth offset (whatever the DX equivilent of glDepthOffset is). Draw with solid colour or alternate texture, *only* when depth test fails.

Share this post


Link to post
Share on other sites
Not sure why you need offsets.
1)Draw Scenery as normal
2)Draw tank as normal (with ZTest: draw if newZ3)Draw tank in solid colour (with ZTest: draw if newZ>=oldZ)
ie draw brown only when you would not normally draw at all - anti-Zbuffering!

Share this post


Link to post
Share on other sites
quote:
Original post by d000hg
Not sure why you need offsets.
1)Draw Scenery as normal
2)Draw tank as normal (with ZTest: draw if newZ3)Draw tank in solid colour (with ZTest: draw if newZ>=oldZ)
ie draw brown only when you would not normally draw at all - anti-Zbuffering!


''cos with that method, on the second time your new z will always equal the old where the tank was visible, so you''d end up tinting your entire tank solid colour.

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!