Skip to main content
GameDev.net gamedev.net
🔒 Locked

Render the render

Started by nail85 Jan 20, 2004 at 6:08 AM 6 replies 950+ views
Original Post
nail85
nail85
Consider following situation. I need to render digital camera on the screen, camera shows it''s picture on the LCD display in real time. What is the best solution to realize this situation in the game? Please don''t submit most obvious solution: render to texture from objective camera and then map it to the LCD display. This method is very slow. Who knows the best solution? P.S. Image on LCD can be some approximation of the real image wich we should to see.
Direct4D
Direct4D
Another way is to use the same technique used for doing mirrors with the stencil buffer. ( well, i think that would work... )

EDIT: sorry, i can't be more specific on it because i never tried it myself. But on nvidia there are some documents describing how to do mirroring with the stencil buffer.


[edited by - Direct4D on January 20, 2004 7:28:06 AM]
jollyjeffers
jollyjeffers
quote:
Who knows the best solution?


you already do. Render To Texture. But if you don''t want to use that, then I''m sure we can think of some worse way of doing it.

on modern video cards (read:dx9 series) then a single RTT will not hurt you much unless you''re really hitting the limits of the pixel pipeline (maybe the TnL pipe as well).

if it is a problem, just do some heavy culling - chances are less has to be rendered that the camera can see compared with what the user can see... and you may even be able to use the first pass (For the camera) to cache some results for the second (main display) pass.. although thats just a shot in the dark.

Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
OrangyTang
OrangyTang
quote:
Original post by Direct4D
Another way is to use the same technique used for doing mirrors with the stencil buffer. ( well, i think that would work... )

But if this is for a security camera and not a reflection then the camera display would change as you viewed it from different angles - not a good thing! You''d have to somehow collapse all the geometry down into a single flat plane and position it on your display surface, which is going to cause lots of z-fighting.

[S-Type] [V-Script]
nail85
nail85
quote:
Original post by jollyjeffers

if it is a problem, just do some heavy culling - chances are less has to be rendered that the camera can see compared with what the user can see... and you may even be able to use the first pass (For the camera) to cache some results for the second (main display) pass.. although thats just a shot in the dark.




Well, well, well you have understand me. I don''t want to render my scene twice per frame. But the main problem how to cache results from first pass to second fast?

I forgot to say one important thing - the camera always looks directly to the LCD display, no angle between LCD''s normal and engine''s camera direction
Direct4D
Direct4D
Well in that case, maybe the following could work:

Render whole scene except for the camera.
Copy the backbuffer to a texture.
Render the camera, use the stored texture for the lcd display.
jollyjeffers
jollyjeffers
quote:
Copy the backbuffer to a texture.


right... afaik thats just a very slow version of render-to-texture

quote:
Well, well, well you have understand me. I don''t want to render my scene twice per frame.


I always did understand you and fair enough if you don''t wanna render twice per frame.

Another option, render your image to a texture, use that texture as the LCD display of the camera; and then draw the camera body as 2D geometry. Or alternatively play with the viewport settings and do 2 frames per cycle. It entirely depends on how much of the screen you can see "around" the camera body (can you see ANY of the scene on the LCD anywhere except for the LCD?)

Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
nail85
nail85
quote:
Original post by jollyjeffers
Another option, render your image to a texture, use that texture as the LCD display of the camera; and then draw the camera body as 2D geometry. Or alternatively play with the viewport settings and do 2 frames per cycle. It entirely depends on how much of the screen you can see "around" the camera body (can you see ANY of the scene on the LCD anywhere except for the LCD?)



Yes, I see, that is the main problem . If the best decision is to play with the viewport than how copy backbuffer already presented to the whole screen into the smaller rectangle wich is the LCD display without big time penalty?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.