CUbe Mapping issues

Blitz3D Forums/Blitz3D Programming/CUbe Mapping issues

Jerome Squalor(Posted 2008) [#1]
Hi all,

i have just recently started to use cubemapping. For some reason the reflections seem huge, is there a way to fix this?


syntax(Posted 2008) [#2]
it would be helpful if you posted a pic of what was going on, or offered some source code. This way we can narrow down the possibilities of what is wrong and make sure we are on the same page.


Ross C(Posted 2008) [#3]
It sounds like your using a camera to render the reflection?

If so, try positioning your camera further back from the render. Also, if you make the object your cubemapping, really large, the reflection will stretch over the whole mesh.


Neochrome(Posted 2008) [#4]
this to take into account.

make sure your using the CAMERA's perspective! location of the camera, NOT the actual water object

besure that the texture is SMALL than your screen rez used.

textures for the object are calculated for you by blitz, so you dont need to stretch textures

[these are my findings]


Ross C(Posted 2008) [#5]
Also, set your camera viewport so it's square. So, for a 1024x768 screen, your going to want to use a 512x512 texture, so set your camera viewport to:

CameraViewPort camera,0,0,512,512.

Then you simply copyrect 0,0,512,512 :o)


jfk EO-11110(Posted 2008) [#6]
There are several approaches to position the camera for proper cubemapping, and of course all of them claim to be the correct one.
As far as I see you need to position the camera "behind the mirror" so to say. So if you want reflective water, the env-cam should be positioned at X and Z of the main camera, but on gound - Y, eg. when the water surface Y is 10.3, and the camera is 2 meters over the surface then the env-cam Y would be 10.3 - 2.0 = 8.3 .

You can use CameraZoom to alter the size of the reflection, but a six-sided render will only cover the whole enviroment perfectly with default CameraZoom settings.

Finally, if the enviroment map is static then it will pay to make it as big as possible - if your screen isn't big enough then you can use multiple render passes. But if you plan to update the texture in realtime then I'd suggest to render as many sides as possible simultanously. Eg. rendering 6* 256^2 textures on a min resolution of 800*600 will take only one render. Simply use CameraViewport with 6 cameras. Although, 256 pixel enviroment textures are looking rather blocky.


Jerome Squalor(Posted 2008) [#7]
thnx