Jan
11-21-2003, 06:22 AM
Hi
Iīd like to speed-up my protal-engine a bit by restricting the drawing to only were a portal is placed. That means iīd like to calculate the bounding-rect of the portal-poly, set it as the scissor-rect and let the GPU do the rest.
The problem is, that i donīt know, how i could calculate that rect in screen-space. Does anyone know of a paper, or something, were it gets explained? I couldnīt find something, maybe i searched for the wrong words.
Anyway, during my searching i had another idea:
I could simply render the portal to the stencil-buffer and restrict the rendering to that.
However, although this will restrict the rendering pixel-precise, i am very sure, the gfx-card canīt optimize for that situation very well, can it?
I think, that when i use a scissor-rect it should be possible for the card, to not even rasterizing a hell of o lot of triangles (or parts of triangles), because it should be easy to check if a part of a triangle is inside the scissor rect.
However, when i use the stencil-buffer, then every triangle has to get rasterized completely and then every single pixel gets checked.
This would make the stencil-approach a very inefficient "optimization".
Am i right here, or did i get something wrong?
Bye then,
Jan.
Iīd like to speed-up my protal-engine a bit by restricting the drawing to only were a portal is placed. That means iīd like to calculate the bounding-rect of the portal-poly, set it as the scissor-rect and let the GPU do the rest.
The problem is, that i donīt know, how i could calculate that rect in screen-space. Does anyone know of a paper, or something, were it gets explained? I couldnīt find something, maybe i searched for the wrong words.
Anyway, during my searching i had another idea:
I could simply render the portal to the stencil-buffer and restrict the rendering to that.
However, although this will restrict the rendering pixel-precise, i am very sure, the gfx-card canīt optimize for that situation very well, can it?
I think, that when i use a scissor-rect it should be possible for the card, to not even rasterizing a hell of o lot of triangles (or parts of triangles), because it should be easy to check if a part of a triangle is inside the scissor rect.
However, when i use the stencil-buffer, then every triangle has to get rasterized completely and then every single pixel gets checked.
This would make the stencil-approach a very inefficient "optimization".
Am i right here, or did i get something wrong?
Bye then,
Jan.