About Store Forum Documentation Contact



Post Reply 
environment mapping or something similar ?
Author Message
mih Offline
Member

Post: #1
environment mapping or something similar ?
Hi smile 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 ? smile

Ps.sorry for mistakes xD
11-23-2009 07:29 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
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
Find all posts by this user Quote this message in a reply
mih Offline
Member

Post: #3
RE: environment mapping or something similar ?
ok thanks wink 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
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
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
Find all posts by this user Quote this message in a reply
mih Offline
Member

Post: #5
RE: environment mapping or something similar ?
yes i know smile 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
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #6
RE: environment mapping or something similar ?
yes
11-23-2009 09:56 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #7
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
Find all posts by this user Quote this message in a reply
mih Offline
Member

Post: #8
RE: environment mapping or something similar ?
ok thanks i'll try that wink
11-23-2009 10:04 PM
Find all posts by this user Quote this message in a reply
Post Reply