Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Render Dynamic Cube Map not rendering (Set Camera To Image the culprit?)

Author
Message
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Apr 2015 14:24 Edited at: 23rd Apr 2015 14:43
Unfortunately I do not appear to be able to 'Set Camera To Image' and 'Render Dynamic Cube Map' in the same DarkBASIC executable. I am posting this message here because it is unclear to me where the problem is coming from (DarkBASIC/DarkSHADER or NVidia); it will also be useful for the users of this particular forum section to know my current work around.



Let me explain this further. In this example program, which requires the attached reflection shader, setting my var named UseRenderTargetMethod to 0 will cause the program to send Camera 1's output to an image; which also stops the cubemap reflection from working.

The cubemap is rendered correctly when UseRenderTargetMethod is set to true (or any non-zero integer); making use of the Draw To Image work around which is less concise than a simple call to Set Camera To Iamge.


In the test, you are a red sphere. The lower cube reflects you and the gray sphere, the additional camera renders the lower cube and draws what is seen on the upper cube; except when Set Camera To Image is used, in which case nothing is reflected; at least on my machine.

The code example requires Matrix1 and Dark Shader functions.

Perhaps the problem has something to do with my Graphics card (GeForce GT740) because I do not remember not being able to use the two commands together.

Take this as a work around if you experience the same problem. Please do offer any valid suggestions and I will be most grateful for your expert advice.

Login to post a reply

Server time is: 2026-07-05 06:06:25
Your offset time is: 2026-07-05 06:06:25