Jump to content
  • Advertisement
Sign in to follow this  
cubicwang

How to create decal on geometry use GPU feature?

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

Hi, I am trying to generate decals such as the bullet hole on a geometry, I read the article <[color=#222222][font=arial, sans-serif][size=2]Applying Decals to Arbitrary Surfaces[/font]> in[font="arial, sans-serif"] game programming gems 2, the article give the math method for picking triangles from geometry. But I think the method is a [/font][font=song, Verdana]

CPU-intensive process, can someone give me a method for better performance or use such as the graphic feature to do that?[/font]
[font="song, Verdana"]


[/font]
[font="song, Verdana"]

Thank you so much!
[/font]

[font="arial, sans-serif"]
[/font]

Share this post


Link to post
Share on other sites
Advertisement
One thing that works quite well is just projected decals. Similar to deferred lighting, you create simple geometry to encompass your decal, then after GBuffer is made, do a pass where you draw these simple meshes, and apply decals based on gbuffer content, exactly like you would for a spotlight.

Share this post


Link to post
Share on other sites
The method described in GPG2 is very efficient and practical. I've been using it for over ten years (since the time I wrote the article), and I've been extremely happy with it. It's important to realize that the polygon clipping only happens once, when the decal is created, so it's not like you're spending time building the decal every frame. It does not cause a performance problem. Managing the decal on the CPU also has certain advantages that you can't get in a GPU-only method. For example, suppose a decal was created on an object that later moves, like a door opening or a barrel rolling down a hill. If the portions of the decal applied to those objects inherit the transform properly, then the decals move with the objects they are attached to. Even if the transforms were communicated to the GPU, a deferred rendering technique would have a serious problem trying to distinguish between the geometries to which the decal should be applied and those that may be near the decal now but shouldn't have the decal applied to them.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!