Page 1 of 1
Virtual cameras and shaders
Posted: Wed Nov 09, 2011 10:42 am
by Staer9
Would it be possible to add a vitual camera in the center of a ship which renders temporary cube maps which can, in turn, be used with a shader to render refections on ships?
The shader from Griffs Krait already uses something similar to create virtual reflections from a pre-made map.
However I presume that the camera-in-a-ship thing would have to be part of the core game which is why I'm posting this here.
Re: Virtual cameras and shaders
Posted: Wed Nov 09, 2011 2:03 pm
by Svengali
You could try to frickle around with the buffers. I've tried to grab the real environment for the Hyperjump shader in BGS, but never got this working properly and used in the end a simple texture.
Re: Virtual cameras and shaders
Posted: Wed Nov 09, 2011 7:54 pm
by Staer9
It's got me wondering...
It might be possible to acheive the effect with the screen-dump function, it would just have to be set to replace the previous one at set intervals (changable depending on the spec of your machine), unfortunately oolite cannot screen-dump from un-active cameras (eg those from external veiws) which would work much better because it could be set up to render a cube-map, or possibly a spherical texture
like the ones used for planets, the problem that then comes is the need for some bit of clever code that maps that map to the diffuse map appropriately.
It's quite a job, but should be acheivable