mih
Member
|
environment mapping or something similar ?
Hi I was trying to make some real time reflections, or almost real time(so they could be updated every couple of seconds or minutes). And I hit on idea that i will set the camera in the place where is the object that reflections will be applied to, and take 6 pictures around the object(front,left,right etc) and make a cubemap from those pictures(or just make the cubemap from the camera view, don't know if it's possible ?), and then apply that cubemap to the material of that object as reflection texture. Is it possible to do ? And will it not be to slow ?
Ps.sorry for mistakes xD
|
|
11-23-2009 07:29 PM |
|
Esenthel
Administrator
|
RE: environment mapping or something similar ?
currently the reflection textures in materials are only 2D textures,
however I'm planning to change that (from 2D into cube textures) into next engine release.
however rendering realtime reflections (especially 6 of them) is rather slow, so I'd recommend to render them only 1 time, save as images, and convert to cube texture, then use it in material.
realtime cube reflections will be supported in the future
|
|
11-23-2009 07:54 PM |
|
mih
Member
|
RE: environment mapping or something similar ?
ok thanks is it possible to take take screenshot from the camera which is not active ? so i could render whole scene without changing the camera for a second to take screenshot( I want to place the camera in some place of the scene and then take screenshot from that camera, while the main camera will be in completly different place)
|
|
11-23-2009 08:32 PM |
|
Esenthel
Administrator
|
RE: environment mapping or something similar ?
you must use two cameras, one=main, second for rendering the cube map faces
|
|
11-23-2009 08:37 PM |
|
mih
Member
|
RE: environment mapping or something similar ?
yes i know but how to save to file or to Image type variable, what that second camera see ?
because capture, and screeShot functions from Rendertarget.h works only on the main(active) camera. So do i have to make that second camera the main camera for a second, take a screenshot, and then again change to the main camera which was set at the begining ?
|
|
11-23-2009 08:48 PM |
|
Esenthel
Administrator
|
RE: environment mapping or something similar ?
yes
|
|
11-23-2009 09:56 PM |
|
Esenthel
Administrator
|
RE: environment mapping or something similar ?
something like this:
Code:
void draw()
{
if(make cube)
{
setcamera left; renderer(..); screenshot("left)
setcamera right; renderer(..); screenshot("right)
|
|
11-23-2009 09:59 PM |
|
mih
Member
|
RE: environment mapping or something similar ?
ok thanks i'll try that
|
|
11-23-2009 10:04 PM |
|