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.

Dark GDK / DDS skycube

Author
Message
Slow Target
16
Years of Service
User Offline
Joined: 10th Jan 2008
Location:
Posted: 11th Jan 2008 05:54
The documentation on Dark GDK is pretty sparce, and I'm just stumbling along blindly with some of this stuff...

I found a nice looking sky cube in .DDS format
[href=null]
http://simul.co.uk/wp-content/uploads/cloudwright/sample/MorningSkyCube.dds[/href]

How do I turn it into a skybox that I can position a camera inside of?

dbMakeObjectCube(2,1024);
dbLoadImage("MorningSkyCube.dds",2,0);
dbTextureObject(2,2);
dbSetObjectLight ( 2, 0 );
dbSetAlphaMappingOn ( 2, 100); //I've tried with and without this line

makes a box with the texture mapped to it that I can see from a camera placed outside of it. When I move the camera inside the box with
dbPositionCamera ( 100, -20, -150 );

I just see blue screen (and my little airplane model flying loops near that camera position so I know that at least something is working)

TIA,

John
Pharoseer
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: Right behind you
Posted: 11th Jan 2008 09:05
Hey John,

Try making the size of your cube less than zero. Like so:



And see how that works. Hope this helps!

-Frank
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 11th Jan 2008 11:14
The problem is, that the sides of your box are oriented out of the box. You can use the following command to set inverse culling for the object (the iFlag should be 2 I hope, the documentation is vague again):

void dbSetObjectCull ( int iObject, int iFlag )
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th Jan 2008 20:38
Either method will work - though I thought the Object culling makes for a bit more overhead then the negative object size approach.

tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 11th Jan 2008 22:48
Quote: "Either method will work - though I thought the Object culling makes for a bit more overhead then the negative object size approach."


That's right. Althought it wouldn't be measurable in any way.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 11th Jan 2008 23:47
(You know I'm glad you said that - because I did a terrain test... and was occasionally getting lost "Under it" so I turned it on and FPS were the same!!! But I heard "No No that is bad" hahhaah thanx for that clarification - More Overhead - but not as if you added another 50,000 poly!

tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 12th Jan 2008 00:06
It's a bit more complicated. Actually in Direct3D (namely 9, for 10 it's a lot different) these pipeline setting calls really does a big overhead (for many games they represent a bottleneck), but not just one call - they are being counted in thousands per frame (here ts is a single call per frame). Besides, it does matter in a well designed low-level engine. It doesn't matter if you use something like GDK, where the overhead is already so dramatic, that you can't really measure such thing. Finally, it is also possible that they set the object culling state anyway if you change it or not.

On the other hand - if both mentioned ways work, then what you said is right - it's an overhead (measurable or not) and so it is unnecessary.
Slow Target
16
Years of Service
User Offline
Joined: 10th Jan 2008
Location:
Posted: 12th Jan 2008 17:51
Thanks to all for the help!

Now that I can see the clouds, the format (which portion of the image gets pasted to which cube surface and at what orientation) seems to be funky (not what dbTextureObject() expects when mapping a DDS). Is there a way to tell what part of the texture goes on which face of the cube?

At this point, i'd probably punt, and say thanks for the diffucult to use free skybox texture, but I'm also curious on how some of this stuff works...
Slow Target
16
Years of Service
User Offline
Joined: 10th Jan 2008
Location:
Posted: 12th Jan 2008 18:46
After a closer look, it appear that the +x face has simply been repeated on all of the cube faces.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 13th Jan 2008 00:17
See if this helps ya - load the Object, and you MIGHT have to Skin it and/or messaround. See Attached

Gave ya a couple things to play with for that.

Attachments

Login to view attachments
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 13th Jan 2008 12:01
Quote: "After a closer look, it appear that the +x face has simply been repeated on all of the cube faces."


The automatically created cube model is textured with a single square texture, but you want to apply more complex texture on it (a different square on each side). One possible way is to load 6 separate textures, one on each side (Jason provided a model which uses this - and those textures are pretty cool) or have all the squares in one texture file, but you then have to map it properly - if you can work with some 3D studio, you can map your cube yourself - it's a very basic task.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Jan 2008 05:36
Good Advice.

There is also another technie - which I use, and thats make code to actually BUILD the SkyBox in memory. You make a triangle ... say 1,1,1,1,1,1,1,1,1 (Basically this teenie thing - one poly... it is the center. Then you make a plain, and texture it with a image (of the 6 like TempIceK mentioned), then flip it into position, and then make it into a limb. Not necessarily in that order... hmm... I might have a partial C++ snippet if you want to try to figure it out:



Login to post a reply

Server time is: 2024-11-17 02:51:59
Your offset time is: 2024-11-17 02:51:59