Virtual cameras and shaders

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Virtual cameras and shaders

Post 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.
Image
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Virtual cameras and shaders

Post 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.
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Re: Virtual cameras and shaders

Post 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
Image
Post Reply