Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / Game Design & Programming / User Defined Clip Planes (Direct3D 9) Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
superlover

March 16, 2005, 07:29 AM

Hi, I'm a newbie in DX programming.
I wanna use 3 planes to divide the view frustum into 4 parts, and then
render each of them into a specific texture. How can I do that?
Any suggestion will be appreciated!

 
Illco

March 16, 2005, 07:43 AM

If the dividing planes disect the frustum parallel to the viewing plane, then you could easily move the camera down the viewin direction and render to texture. Of course, you can do the same for any disection, only positioning the camera is a little more complicated. I'm not sure if this answers your question however.

 
Scoot

March 16, 2005, 07:59 AM

Just a thought since i've never used them myself, but check out viewports - you can change the viewport parameters for each of the four segments and render to surface.

Just look up SetViewport() in D3D help docs...

[S]

 
superlover

March 16, 2005, 08:27 AM

Hi, thanks for your help!
Although the partition planes parallel to the view plane, I'm still not very sure your meaning (sorry for my ignorance),
1. how can such kind of camera's moving (along z direction) render only one of 4 dividied parts?
2. if I wanna render each of them into a texture from another point (not viewpoint), how to do that?

 
superlover

March 16, 2005, 08:31 AM

Hi, thanks for your reply.
I've checked the docs about "SetViewPort", but the following words confused me:(

typedef struct _D3DVIEWPORT9 {
DWORD X;
DWORD Y;
DWORD Width;
DWORD Height;
float MinZ;
float MaxZ;
} D3DVIEWPORT9;

"The MinZ and MaxZ are typically set to 0.0 and 1.0 but can be set to other values to achieve specific effects. For example, you might set them both to 0.0 to force the system to render objects to the foreground of a scene, or both to 1.0 to force the objects into the background. "

anybody could explain that in detail? thanks.

 
Scoot

March 16, 2005, 08:40 AM

Right, its pretty simple - MinZ and MaxZ set the near and far clipping planes, and the zbuffer range (if applicable).

If youve rendered a scene with full zbuffer support, and you want to render something over the top, by setting the z-range to 0.0-0.0, anything you draw subsequently will automatically have drawing precedence over that already rendered, as the resulting zbuffer values will only ever be 0.0 (obviously less than anything else in the buffer)...

If you only want to change the X,Y and Width,Height parameters then you can retrieve the current values for min and max Z by using GetViewport() first.

Hope that helps

[S]

 
superlover

March 16, 2005, 08:54 AM

thanks very much!
say the 3 partitioned planes located at z1, z2 and z3, so do you mean I just need to set up ZMin and ZMas as (near, z1),(z1,z2),(z2,z3) and (z3, far) in SetViewPort?
and another question is
"if I wanna render each of them into a surface at a position which is different from viewpoint (e.g. light's position), how can I do that?"

 
This thread contains 7 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.