So I am working on a game that deals with scenes that are a realistic replica of solar systems, as you can imagine, the rendering distances are very large but is sparsely populated. To extend the camera range, I am using the setFarValue on the camera, bit it tops out at 9,999,999 units. After googling, it seems that this limitation is because of maxing out the memory value that is assigned to it (4 bit float i think), is there any way around this or a different function that I can use?
There is also the option of rendering other small objects in this local area manner and rendering celestials that are far away some way else? Also, even if the render distance is low and I wouldn't be able to see the system star (That is generating light), would the light being generated still travel through the system and illuminate objects?
Thank you!
setFarValue Limitation
Re: setFarValue Limitation
You either fake it somehow or you need a logarithmic z-buffer. I've not tried yet if it's possible to get those with the current shader support in Irrlicht. Maybe google for glsl and logarithmic z buffer.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: setFarValue Limitation
Keep in mind the precission. It is not that much a matter of distance than precission. Think that a regular ZBuffer has 24 bits, and it has to distribute along the near and far planes, thus, setting the distances may saturate the range of the objects you're rendering losing accuracy. The solution i'd think about is rendering the objects in diferent passes, with diferent near/far planes. IF you're getting too close to a planet, render that planet with another distance setting. Of course, keeping in mind that the objects distances won't affect each other, i.e. a far planet can be discarded when it comes to ZBuffering and the like.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: setFarValue Limitation
A great resource for near/far plane values is http://www.sjbaker.org/steve/omniv/love ... uffer.html
It has a javascript calculator that lets you enter the near and far values and tells you the precision at different distances.
It has a javascript calculator that lets you enter the near and far values and tells you the precision at different distances.