very strange multiple viewports problem

Started by
6 comments, last by discman1028 18 years ago
I wrote a demo yesterday to create multiple viewports. All went well, and I had the same scene rendered to the center of each viewport, from different camera angles. A screen shot can be seen here: http://users.wpi.edu/~wap/CS_MQP/weeks/week_2.htm The next morning, I didn't TOUCH the code, and I was getting different behavior. Both scenes were overlapping in the middle of the window instead of the center of each viewport!! The source code is a link near the bottom of the page, as well as an executable, to see the problem. It's very strange! I can't figure out how to fix it. Thanks for any insight
--== discman1028 ==--
Advertisement
Sounds like you haven't set all your device states and that the only reason it was sorking before was because something you ran before your application setup the device states that you didn't.

Hope that helps. Greg
Okay, thanks, I'll check, and do comparisons with other source.

Could you run the executable and see if maybe it looks okay for you? I swear I didn't change any source code overnight, but I may be going crazy. :)
--== discman1028 ==--
Here are the two screens, for quick comparison. I still can't figure it out... still looking.

http://www.angelfire.com/retro/there/shots.html
--== discman1028 ==--
You have turned on the debug runtime right?

The Z values for a viewport need between 0 and 1. You use -1 as MinZ. The debug Runtime checks this and will not set the new viewport. The release runtime doesn’t do this checks and it will work even with the wrong values because the driver is more tolerant then the debug runtime.
Even in Debug mode, it was compiling ok. But that is the solution: 0 instead of -1. I feel foolish for that one...

Thanks
--== discman1028 ==--
I don’t talk about the debug build from the compiler. The DirectX SDK install an additional Direct3D debug Runtime and a control panel program that allow you to switch between the debug and release runtime. It will add an additional option page to Visual Studio, too. If you enable this debug runtime it will do additional checks at runtime.
Yeh, I believe I have DX debug mode always turned on (set from the Windows Control Panel). Though, I have not seen the "additional options" page.
--== discman1028 ==--

This topic is closed to new replies.

Advertisement