Jump to content

  • Log In with Google      Sign In   
  • Create Account


Lining up a projection within a projection


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Tessellator   Members   -  Reputation: 578

Like
0Likes
Like

Posted 28 March 2007 - 05:18 AM

Hi, So, I have a scene being rendered with a perspective projection matrix. I also have a rectangular region on the screen that I'd like to render onto another render target and then place back over the scene so that you don't notice any seams. To this end, I've attempted to create an offset/sheared perspective projection matrix that encompases the bit of scene I want to render. This almost works, but I end up with issues where the object is scaled differently using the sheared matrix. I've created the sheared projection matrix in a couple of ways, 1) using trig and 2) by back projecting the extents of the rectanglular region onto the near plane and constructing the new projection in camera space. Both methods seem to give the same kind of error. Has anyone done this kind of thing before? I imagine it's the kind of thing people might find useful in portal engines or when rendering render-to-texture mirrors etc. Can anybody help with this? Many many many thanks, T

Sponsor:

#2 haphazardlynamed   Members   -  Reputation: 340

Like
0Likes
Like

Posted 28 March 2007 - 05:20 AM

For the portal or mirror examples, generally we don't render to a texture as you suggest; rather we use a stencil to mask the polygon, then do a second render pass directly to screen.

-its when we want the proejctions to Not Match that we use a texture; such as when rendering a secuirty camera monitor or something...

#3 Tessellator   Members   -  Reputation: 578

Like
0Likes
Like

Posted 28 March 2007 - 09:55 AM

There are cases though where you'd want to render the portal to a texture so that you could distort it when rendering it back into the scene.

T

#4 haphazardlynamed   Members   -  Reputation: 340

Like
0Likes
Like

Posted 28 March 2007 - 11:15 AM

Quote:
Original post by Tessellator
There are cases though where you'd want to render the portal to a texture so that you could distort it when rendering it back into the scene.

T


In that case, why not go with the stencil approach, and simply distort the projection matrix of the second pass?

Seems that this would be easier than doing a perspective distortion/skew to match the 2d texture's location, followed by an additional distortion for the specific special effect itself.



Or does the distortion effect you want require texture operations to be achieved?
IE, heat waves... 8bit graphics style effects... etc?

#5 Tessellator   Members   -  Reputation: 578

Like
0Likes
Like

Posted 28 March 2007 - 09:18 PM

Hello haphazardlynamed,

Yeah, the distortion effects would be per-pixel so it really needs to be in another texture. Cheers so far though [smile].

T




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS