Jump to content
  • Advertisement
Sign in to follow this  
Kest

Scorching Everything

This topic is 4414 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 trying to come up with an alternative method of showing burns on objects other than with decals. The scenes in my project will contain a lot of round and complex-shaped props, and I don't think it will be feasible to attach decals to all of the surfaces using the same technique. If I'm unable to scorch everything the same way, I would prefer to not scorch anything. I wouldn't want scorched flat desks with bright and shiny lamps on them, for example. One idea I had was to use spherical objects. Simple spheres that attach to render elements at specific locations with radius. They would get sent to the vertex shader and used to darken vertex colors. I'm not sure how decent it would look, though. And it would rely on polygons being fairly high-res. It would be impossible to scorch the center of a long hall-way floor polygon. Are there any other methods to solve this? I appreciate any info.

Share this post


Link to post
Share on other sites
Advertisement
One way could be to dynamically CSG some things, take the fire shape (sphere or whatever shape the fire is), and cut the scene there (a copy of the scene). Get the intersection of the scene inside that sphere, make a new mesh for it, and use the burn textures for it.

Share this post


Link to post
Share on other sites
That would work well for static scenes. But most objects will be dynamic, movable, animatable, or destructable.

I appreciate your ideas, though.

I should also mention that I realize the ease of scorching whole objects, and that some small objects would always be scorched all at once (probably the lamp I used as my example). So my problem is mainly just with sub-areas of larger objects being scorched. Tables, sofas, vehicles, people, etc.

Share this post


Link to post
Share on other sites
You could decal everything, but make the CPU do all the donkey-work. Fitting a load of flat decals to an arbitrary concave object sounds like a bit of a nightmare, but if you consider that almost all situations that require decals originate from some kind of explosion, the linear radial nature of projective texturing could do all the work for you without much of a performance hit.

A bullet travels in a straight line, with a circular cross-section. If you project a texture along this line onto whatever it happens to hit, you can get quite complex bullet holes with minimal effort.
Similarly, an explosion could be modelled as a bunch of overlapping 'pancake-shaped' burn marks diverging out from a central point. Again, projective texturing reduces the vertex-texel mapping to near triviality, while giving a realistic-looking effect.

Regards
Admiral

Share this post


Link to post
Share on other sites
One of my goals is to have objects stay scorched indefinitely. That means the quick full-scorching of objects will be really useful. Do you think it would be possible to switch from using decals on partial areas to full-scorching using an alternatively quick method, without having the previously scorched areas "morph"? I mean, speaking fully from an example situation where a character scorches one area of an object (such as with a flame-thrower), then the rest.

I would either need to make the full scorch look like the decals or the decals look like the full-scorch. I don't think I can get the partial decal-scorch to look the same as a simple full lighting-scorch.

It's possible that I'm just too inexperienced with decaling to comprehend it's potential. Maybe I should play around with that.

Thanks for your suggestions.

Share this post


Link to post
Share on other sites
why not use the same approach as is done with lightmapping. All surfaces have a unique texture applied, which if you modify the texture (ie paint/project on a scorch marks) it will stay for ever. Problem with this is may be to low res for your needs. Not sure how much it costs to have a texture your always changing though.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kest
One idea I had was to use spherical objects. Simple spheres that attach to render elements at specific locations with radius. They would get sent to the vertex shader and used to darken vertex colors. I'm not sure how decent it would look, though. And it would rely on polygons being fairly high-res. It would be impossible to scorch the center of a long hall-way floor polygon.

Why not combine this approach with projective texturing? Instead of doing a simple per-vertex darken you could project a scorched texture onto the affected area. You wouldn't have to worry about having high-res objects and the end result would probably look better too.

Share this post


Link to post
Share on other sites
Quote:
Original post by OrangyTang
Quote:
Original post by Kest
One idea I had was to use spherical objects. Simple spheres that attach to render elements at specific locations with radius. They would get sent to the vertex shader and used to darken vertex colors. I'm not sure how decent it would look, though. And it would rely on polygons being fairly high-res. It would be impossible to scorch the center of a long hall-way floor polygon.

Why not combine this approach with projective texturing? Instead of doing a simple per-vertex darken you could project a scorched texture onto the affected area. You wouldn't have to worry about having high-res objects and the end result would probably look better too.

Do you mean the spherical objects would effect the vertices in such a way as to control the blending of the scorched texture? Something like terrain texture blending? Or something else? I'm not clear on how I could effect several seperated areas of a single object without using the vertices. Such as burning the left side, then burning the right side, and have the center remain normal.

Thanks to both of you for your time [smile]

Share this post


Link to post
Share on other sites
As I understand it, you wanted to create spherical areas where objects within them look blackened and burnt (lets calls these areas 'BurnVolumes'). When there is an explosion/whatever, you'd create new burn volumes attached to all the geometry nearby.

So now when you draw a mesh you may have to apply multiple burn volumes. We'll keep things simple and do a draw pass for each volume - so first you'd draw the base model, then blend each burn volume over the top.

For each volume you'd re-draw the mesh with a special shader. In the vertex shader you'd compute the location of that vertex within the 3d volume. You'd pass this along as a per-vertex parameter. Then a pixel shader would interpolate this 3d position, and use it too look up into one (or more) burn textures. The burn texture would then just be blended over the top of the original mesh.

Because you're interpolating coordinates, not colours, you effectively get per-pixel burn rather than per-vertex. This means that big polys get affected the same way as highly tessalated areas.

The whole idea is pretty close to regular per-pixel lighting, except instead of a lighting equation you're using burn textures.

Share this post


Link to post
Share on other sites
nVidia had a paper about "render to texture caching" a couple of years back, which described a technique similar to supagu's lightmap idea.
Maybe that'll be something to look at.

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!