JoeJ wrote:Julios: if you fire 20 bullets on a big polygon, you need to render big polygon 20 times? fillrate consuming
To avoid stretch, skip triangles if fabs(dot(hitray, trinorm)) < threshold
PolyClip: CPU consuming
That's is no what I meant.
here is more detal.
say you have a decal manager tha keeo track of every decal on the screen.
each decal point to a list of faces that it touched.
each time a Face is affected by a decalm, you add a new facr teh list of faces tha nee to ne rendered.
you also save a render to texture image of the face.
there you produce an texture that containt the image of the decal, tsho tetirue is genertaed each time any decal changes.
all of the clipping si doen by UV tricks, and all you do is rendring lot of small texture to a larger one.
The texture will have on bullte, the two bullets, and so on
Julios: if you fire 20 bullets on a big polygon, you need to render big polygon 20 times? fillrate consuming
not, you render the 20 bullets using UV shifting 20 time to an off screen image. but those 20 time do no haven in the same frame
it only happen each time the offcreeen decal is touche by a new bullet or a new bullet is remioved.
In fact I wodul no even bother cleaning old bullet hole holes.
then you render the poligon wit the exact same poligon faces twice.
Basically you cna generalize the compelet featore like this,
you make a secung mesh of the object that you wna to render.
the secund mesh have all the UV set to zero.
each face o fteh buidledn have a assigned texture tah is blank
each time a decal touches a face, you figer out when on teh face teh decal is to be rendered, you find that texture and you render that decal to thar texture. the you add that face to the displalist
The you simply render that display list with some alpha blended or some blend shader.
no where you need to do any clipping.