Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Cube Mapping issue

Author
Message
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 5th Sep 2003 10:23 Edited at: 5th Sep 2003 10:35
[/b][b]I wrote the following code to test cube mapping
The images are a panoramic set of images but I understand that any image should work.

The system reports back with a "1" so my card supports cube mapping but all I get is a spinning white cube.

What other commands are needed for this feature?




System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 5th Sep 2003 11:53
I can't see anything immediately wrong with your code but here are a few pointers for you:

1) Your ambient light level is too high. 80 would "wash out" the colours. You will probably find that whatever object you have cube mapped needs to actually turn off it's response to ambient and scene lights otherwise it kills the effect. See my code for an example.

2) You don't need the specular command.

3) Cube Mapping a box won't give a very good result, the object is simply too flat. It will work, it just won't make cube mapping look very impressive, use a sphere instead.

4) You have mapped your object in the wrong order. It should be mapped as follows:

Front, Back, Top, Bottom, Left, Right

Without seeing the textures you're using I can't comment further. The textures should be a uniform size (i.e. 256x256 or 512x512) and should be applied to the object in the correct sequence as above. I have attached my source code to this post, I know it works so it might be worth starting with it. Also I have uploaded a ZIP file with my home-grown cube map in it (thanks Bryce!) so you have all the media and code, you can get it from here:

http://files.thegamecreators.com/team/cubemap.zip - 1.52MB in size.

If it fails to work for you then I would suggest reducing the size of the images to 256x256 and try again. If that works then basically you ran out of video memory for the effect.

Cheers,

Rich

"Gentlemen, we have short-circuited the Universe!"
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 5th Sep 2003 20:37 Edited at: 5th Sep 2003 20:48
Thanks Rich.

The problem was caused by my not having the files in a uniform size.
How would you know that this is required and also where was the strange order of images defined?

I have created a Cube Mapped Sky Sphere that I would like to share with the gang. It is a 360 degree Sky Sphere of a lake. I think it's cool although very limited in its practical application due to the distortion caused by mapping cubes to spheres

http://us.f1.yahoofs.com/users/259440c0/bc/Shard/Cube+Map.zip?BC14LW_AhPKlkUmW


or this link
[href]http://www.geocities.com/[email protected]/CubeMappedSkySphere.zip

[/href]

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX

Login to post a reply

Server time is: 2026-07-23 12:10:12
Your offset time is: 2026-07-23 12:10:12