RE: [Algorithms] Bullets on walls
Brought to you by:
vexxed72
From: <ma...@ci...> - 2000-07-21 16:39:24
|
We do it this way: If the decal does not cross a polygon boundary with a high enough crease angle, draw it as a quad. Use ZBIAS if supported and/or move it along the normal to lift it off the surface. Otherwise draw it as decal, as per Jaimi's method. Remember to enable ALPHATEST so there's no overdraw or fill-rate hit even if the base triangle is large and has several decals. Mipmapping is still a problem - clamp mip levels to a minimum size (16x16 or 32x32) and make sure your algorithm maintains the alpha==0 border all the way, otherwise decals at oblique angles will bleed over the whole base triangle. For small decals like bulletholes just don't mipmap them (and use a suitably low-res texture). -=Mark=- Mark Atkinson, Technical Director, Computer Artworks Ltd. http://www.artworks.co.uk > Using overlay textures would require you to use a ton of unique textures. > . > . can become very unreasonable quickly. > > Gary > > -----Original Message----- > From: Mark Wayland [mailto:mwa...@to...] > Sent: Thursday, July 20, 2000 9:55 PM > To: gda...@li... > Subject: Re: [Algorithms] Bullets on walls > > > An extension to Jaimi's method may be to render the bullet holes to an > overlay texture (of which you would have a maximum number) which is only > rendered *once* on-top of the wall. With complex texture mapping this is > obviously not possible, but perhaps for simple quads it would be > acceptable > ? > > Perhaps some form of scalable solution - like use Jaimi's method for a > small > number and when a threshold is reached, combine them into the single > texture > as I've mentioned and repeat ... ?? > > Just my 2c worth ... > > Mark > > > In d3d, this is the way I do it: > > > > Create decals with a one pixel transparent border. > > Then, set the texture address mode to "Clamp". > > Calculate new UV coordinates for your decal based on the wall, instead > > of the Decal - then redraw the entire wall with your decal texture and > > new UV coordinates. > > This way you do not have to clip at all. I would assume you could > > do the same in OpenGL. > > > > Jaimi > > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > |