RE: [Algorithms] Generation texture co-ordinates for decals
Brought to you by:
vexxed72
From: Chris B. (BUNGIE) <cbu...@mi...> - 2002-08-27 20:49:49
|
The truly insane might also like to consider a spring-relaxation technique that runs in real-time after the projectile hits the surface. Goop gun, anyone? -- Chris Butcher Rendering & Simulation Lead Halo 2 | Bungie Studios bu...@bu... =20 -----Original Message----- From: Charles Bloom [mailto:cb...@cb...]=20 Sent: Tuesday, August 27, 2002 13:44 To: gda...@li... Subject: RE: [Algorithms] Generation texture co-ordinates for decals If you were insane, you would gather the geometry that you want to put the decal on, generate a local non-distorting 2d mapping around the "root point" to decal, and make uv's that way. Basically you're generating a surface->2d local mapping such that the geometric area covered is proportional to the texture area. Anyway, sounds like a pre-process thing, not a real-time thing. At 01:02 PM 8/27/2002 -0700, Chris Butcher (BUNGIE) wrote: > For Oni we ended up literally wrapping the decal's texture coordinate >system across an edge if the angle was large enough. This meant that the >texture would exhibit seams on some edges (can't fold a sticker to >exactly cover a sphere, for example) so it wasn't appropriate for >anything that wasn't basically scorch-like. A priority queue helps so >that you wrap over small inclines preferentially, leaving the seams for >the more right-angle type surfaces. > > This was probably more difficult than it needed to be. For Halo we >simply used the projective texturing approach, with a simple heuristic >to determine whether we should try to wrap across a polygon (skipping >anything that was too oblique to the decal's incoming vector). Remember >that to generate the decal in the first place, you probably don't >exactly want the surface normal, and you definitely don't want the raw >incoming projectile vector. Something between the two worked well for >us. > >-- >Chris Butcher >Rendering & Simulation Lead >Halo 2 | Bungie Studios >bu...@bu... > > >-----Original Message----- >From: Ratcliff, John [mailto:jra...@so...] >Sent: Tuesday, August 27, 2002 11:33 >To: gda...@li... >Subject: [Algorithms] Generation texture co-ordinates for decals > >I thought I had this under control but I am still experiencing some >issues. >When I searched the web for 'decals' most of the examples that showed up >used a projection matrix to generation u/v co-ordinates for a decal. > >This is how I wrote my code, and I then clipped the geometry against the >texture space co-ordinates. This worked ok, in general, except for >polygons which were at oblique angles to the view vector. There the >decal >texture would stretch in a very ugly fashion. > >I decided to look for reference material that showed how to generate U/V >co-ordinates for decals. In "Game Programming Gems 2" there is a brief >blurb in section 4.8 about one way to do this. The section comes with a >tiny source code fragment as well. > >However, when I used the equation provided there to generate u/v >co-ordinates I had similar problems. At oblique angles the texture >co-ordinates would approach infinity. > >When you read the book chapter it has a section about clipping the >geometry, >but it doesn't say whether you *must* have the geometry clipped *before* >you >generate the texture co-ordinates. With my old system I clipped the >geometry to texture space, not in object space. I don't mind clipping >the >geometry in object space, and then generating the texture co-ordinates, >if >that's what I have to do to get this to work. However, I don't >understand >the math well enough to know for sure this will make any difference at >all. > >Does anyone have any familiarity or stategies for how to wrap a decal >around >some arbritrary geometry without it shooting off to infinity at oblique >angles? > >John > > >------------------------------------------------------- >This sf.net email is sponsored by: OSDN - Tired of that same old >cell phone? Get a new here for FREE! >https://www.inphonic.com/r.asp?r=3Dsourceforge1&refcode1=3Dvs3390 >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > > >------------------------------------------------------- >This sf.net email is sponsored by: OSDN - Tired of that same old >cell phone? Get a new here for FREE! >https://www.inphonic.com/r.asp?rurceforge1&refcode13390 >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_ida88 ---------------------------------------------------- Charles Bloom cb...@cb... www.cbloom.com ------------------------------------------------------- This sf.net email is sponsored by: Jabber - The world's fastest growing=20 real-time communications platform! Don't just IM. Build it in!=20 http://www.jabber.com/osdn/xim _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 |