PDA

View Full Version : Viewports



XeviaN
22-07-2003, 09:54 PM
Hi all!
I'm currently developing a 3D editor with the common 4 views (top, left, front, 3d).
I used a panel (VCL) to render to, and divide it in 4 rectangles with the Viewports of DirectX.
Every frame i set the viewport, all renderstates (etc, etc), and render.
Change viewport and so on, 4 times.

So, it seems that the viewport change is a hi-cost operation because its slow down frame rate very badly, even the statechanges and polycount of every frame are not much.

Nevertheless i've no need of a high frame rate count, i'd like to know if there's a better (and faster) method to implement my 4 views editor, using a different method than Viewports.

Thanks in advance :D

Clootie
23-07-2003, 05:54 AM
Actually "SetViewport" change is very cheap for HW.
Seems your problem leis somewhere else. Try set only single viewport (from API point of view) and render all of your four virtual "viewports" to this API viewport - this will show are you really limited by viewport calls. I predict that this will not change much your FPS, assuming viewport are equal sizes and you will set SetRenderState(D3DRS_ZFUNC, CMP_ALWAYS);

XeviaN
23-07-2003, 07:10 PM
Thank you, in the next days i will try some "profiling" and post results.

See you :D