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.

Author
Message
avada kedavra81
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location:
Posted: 7th Dec 2004 05:37
How do I use cube mapping. I have an object and i can type 'turn cube maping on' but what image do I use?

Thanks for reading!
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 7th Dec 2004 06:32
the 6 views around it, think of cube mapping like a reflective surface for it to reflect its surroundings it must have images for whats around it , as there are 6 sides to a cube you must supply it with 6 images, you can use multiple camera and use there viewports as the images.


Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 7th Dec 2004 06:37
I find this confusing too actually.. Maybe a nice simple example would help?

Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 7th Dec 2004 07:00
Take a skysphere, and cubemap it onto a plain.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
avada kedavra81
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location:
Posted: 7th Dec 2004 07:07
But don't you have to provide image numbers as parameters? On the example with the darkbasic pro trial it has "dbprocubemap.dds" as an image and all the faces with this image. Actually, what kind of value are the 'face' parameters for cube mapping, I assumed that they were image values but come to think of it it didn't specify in the command help file. (Does it tell u what type of values to use in the full version of dbpro for each command, like in dbclassic? e.g. "the parameters x and y are real values".)

Thanks for reading!
Jedive
22
Years of Service
User Offline
Joined: 24th Jan 2003
Location: Spain
Posted: 7th Dec 2004 07:19 Edited at: 7th Dec 2004 07:20
The order of the images for the cubemap, if i remember right, is: -x, +x, -y, +y, -z, +z

== Jedive ==
AthlonXP 1600+, 512MB, GeForce4200, WinXP/DX9, Mandrake 10
iBook G4 1Ghz, 256MB, Radeon9200, Mac OS X Panther
avada kedavra81
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location:
Posted: 8th Dec 2004 06:56
I know that u use 6 images, and that they are of the insides of a cube surrounding the object, but how do you obtain them?

Thanks for reading!
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 8th Dec 2004 07:02
There are a number of ways... normally you'd create a cubemap prior to use. However you can just as easily create 6 images, and use cameras to update them for the cube mapping, giving you a realtime cubemap effect

it only really works with a populated area, so you can see what it's doing. don't have time to show you right now, but i'll see about getting some kind of demonstation up and going asap


Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 8th Dec 2004 09:16 Edited at: 8th Dec 2004 09:16
you could use the images from a Skybox. That'd look kinda cool.

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)
The Big Babou
22
Years of Service
User Offline
Joined: 10th Feb 2003
Location: Cyberspace
Posted: 8th Dec 2004 11:51
I didn't already try it, but gile[s] has a render cube map feature.

... they call it a royale with cheese ...
avada kedavra81
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location:
Posted: 9th Dec 2004 01:30
So u can't just create cube map reflections say by using a random scribbly image file, they have to be actual reflections of images in the game?

AMD 1.4 Ghz : 256 Mb RAM : Geforce FX 5200 128Mb : 80Gb HDD : Win 98
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 9th Dec 2004 01:54
they don't have to be in-game reflections.. they can just be a normal skybox; but it is a better effect if they are R/T Reflections


Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Dec 2004 01:56
To get it looking convincing the cubemap has to match - a lot like a skybox texture set. It calculates from any direction you see, so it needs all that information to get a good effect - with any old textures it's look real bad, unless you were going for a space-age patchwork quilt effect.

By using a seperate camera, you can grab the scene directly as Raven suggests - however that can be quite slow. I think that it's best if it's precalculated, so maybe render the default camera to a bitmap and grab the images after loading the level - that way you don't have the hassles of an extra camera which usually halves the frame rate. With cube maps, it does'nt really have to be exact to get a good effect, like a single set of cube map textures could cover quite a decent area without looking too inacurate.


Van-B


It's c**p being the only coder in the village.
avada kedavra81
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location:
Posted: 9th Dec 2004 07:00
Thank-you everyone, maybe I should be in newcomers' corner, but I still don't understand. A sky box is just a box textured on the inside so that it surrounds a level and looks like the sky? And for cube mapping you specify image numbers? You can either use a camera which records to an image number, or just still images from the game or images that u've made yourself? Ok. So why, when I just use random image files (e.g. block of red), does absolutely nothing happen to my object, not even a tiny bit of reflection, just the normal dull, boring colours. (Bearing in mind i'm using DBPro Trial version and the pelican demo on it.)

AMD 1.4 Ghz : 256 Mb RAM : Geforce FX 5200 128Mb : 80Gb HDD : Win 98
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 9th Dec 2004 07:11
because the image has to have something on it...
alright here is what happens with cube mapping.

say you texture a cube and put it in the world, now .. ghost that cube and inside that cube make another object; just make sure that object is always inside that cube.

if you move your object inside the cube whatever is on the cube because it is ghosted will always show in the same direction on your object... but your object is free to move.

that's what cube mapping does really, the only difference is the cube texture is blended with the original texture on the object itself.


Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 9th Dec 2004 10:59
Cube mapping takes a set of images, and fakes reflections.

1800+ XP - GeforceFX 5600 - 256MbDDR - 60Gb Hdd - XP Pro (SP2)
avada kedavra81
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location:
Posted: 10th Dec 2004 02:27 Edited at: 10th Dec 2004 02:28
Ok, i understand. But when I create 6 bmps labelled cube1-6.bmp of just blocks of different colours and run this code...



The cube stays pearly white , and no colour appears on it whatsoever. I suppose this could be that I am using the trail version, but it has an example program that uses cube mapping effectively.

AMD 1.4 Ghz : 256 Mb RAM : Geforce FX 5200 128Mb : 80Gb HDD : Win 98
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 10th Dec 2004 03:12
Here's an example I wrote on how to use cube mapping. Move the mouse to rotate camera.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"

Attachments

Login to view attachments
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Dec 2004 04:50
Heh, remember what I said about the cube. You have to move the view to see the cubemap change, that is the point in it... to provide the model with something that is always in the exact same position, and thus you can fake (or reflect) the current surroundings

It was designed to give a more realistic reflection effect with minimum effort.


avada kedavra81
21
Years of Service
User Offline
Joined: 12th Jul 2003
Location:
Posted: 10th Dec 2004 07:03
Ok, I understand where I've been getting confused. Cube mapping when used properly does actually create realistic relfection effects. When I originally looked on the DBPro features section I saw this then forgot about it. I then got the DBPro trial. This has a project on it called Pelican Demo, in which a pelican model rotates on the screen and has a cube mapping effect. The difference with this is that it is not actually surrounded by scenery, but it seems to have a reflective quality. This, I assume must be done by carefully preparing the image file (this one is in .dds format if that matters) beforehand, and is what I assumed cube mapping does: to make an object look like it is not reflecting anything in particular. Although I now undestand that you can actually make an object reflect actual images, I want to know how to create the effect on this demo (a general shiny effect) using cube mapping

AMD 1.4 Ghz : 256 Mb RAM : Geforce FX 5200 128Mb : 80Gb HDD : Win 98

Login to post a reply

Server time is: 2025-05-29 05:37:23
Your offset time is: 2025-05-29 05:37:23