Fractal Sky
by Josef Jahn · in Torque Game Engine · 11/13/2002 (12:08 pm) · 46 replies
Well, there's one screenshot of my fractal sky in the Snapshot Gallery, so I thought maybe I should add another one in the forums:

The good news is that the only modification neccessary is inside sky.cc - however, once I'll have all the editor/scripting integration and the day/night transition done, you can be sure that there will be changes in other files too ;)

The good news is that the only modification neccessary is inside sky.cc - however, once I'll have all the editor/scripting integration and the day/night transition done, you can be sure that there will be changes in other files too ;)
#22
11/19/2002 (7:34 am)
This looks great. I'll have to see it in action when I get home, but you've done a great job here!
#23
11/20/2002 (6:00 am)
Is there a strings.h file someplace? I get an error when trying to compile the sky.cc file that says - Cannot open include file 'strings.h': no such file or directory.
#24
Second, I use some rather messy C functions that require defines that are different depending on platform. Try removing all the include<*>'s on top of sky.cc and then include what fits your platform to get the undefined functions running.
What else.. hmm...
The renderBans was actually commented out by me. If you don't have that, fine!
11/20/2002 (6:10 am)
First off, I have not tested this on anything except head, although it *should* work with minor modifications. (Sadly my resource hasn't been approved yet, it contains line-by-line instructions on how to add the code to the file yourself)Second, I use some rather messy C functions that require defines that are different depending on platform. Try removing all the include<*>'s on top of sky.cc and then include what fits your platform to get the undefined functions running.
What else.. hmm...
The renderBans was actually commented out by me. If you don't have that, fine!
#25
Edit: Got it working (on WindowsXP)! Just looked at it again a few minutes ago. I used #include instead of the #include and it seems to work now. Sure makes things look different - very cool. There is that "flat" look but overall I think it looks better.
-Sabrecyd
11/20/2002 (6:15 am)
Thanks Josef. I was just looking at the file a little more along with the project settings. I could also just wait until it's approved as a resource :)Edit: Got it working (on WindowsXP)! Just looked at it again a few minutes ago. I used #include
-Sabrecyd
#26
11/26/2002 (6:34 pm)
Thanks Josef. Your skies are a vast improvment. Im very gratefull.
#27
No clues in the console prior to the crash....
11/27/2002 (10:02 am)
I get a crash on mission start also. Running XP - made the change from strings.h to memory.h as per above....No clues in the console prior to the crash....
#28
I'm using #include instead of strings. So I will go try the #include real quick.. see if anything changes...
Do I need to make any changes to the SKY object in the Mission Editor?
11/29/2002 (2:15 am)
Dropping it into the latest HEAD complies fine for me, it even runs but all I get is a gray sky. (No sky I assume)I'm using #include
Do I need to make any changes to the SKY object in the Mission Editor?
#29
If you look into my ugly code (inside loadDML) you'll notice that upon loading the sky textures from the DML file, it's creating one layer of fractal clouds for every texture entry in the DML file. I don't have an example here right now, but you just have to make sure that the sky DML file being used by your mission contains at least the skybox textures AND one to three cloud layer entries. Those entries won't be loaded, but each will create one layer of clouds.
Note that the third layer of clouds will be rendered with blending set to darken the sky. If you want the full effect, use 3 entries. If you only want bright clouds, use <= 2 cloud entries in the DML.
I'm sorry for the messyness. I figure using a keyword like "fractal_light" and "fractal_dark" would be better than this. Also, having only 3 layers is pretty limiting. If anyone cares to improve my feeble work, please do, and share ;)
11/29/2002 (2:21 am)
Heh, yes.If you look into my ugly code (inside loadDML) you'll notice that upon loading the sky textures from the DML file, it's creating one layer of fractal clouds for every texture entry in the DML file. I don't have an example here right now, but you just have to make sure that the sky DML file being used by your mission contains at least the skybox textures AND one to three cloud layer entries. Those entries won't be loaded, but each will create one layer of clouds.
Note that the third layer of clouds will be rendered with blending set to darken the sky. If you want the full effect, use 3 entries. If you only want bright clouds, use <= 2 cloud entries in the DML.
I'm sorry for the messyness. I figure using a keyword like "fractal_light" and "fractal_dark" would be better than this. Also, having only 3 layers is pretty limiting. If anyone cares to improve my feeble work, please do, and share ;)
#30
A side note, when going to run Waterworld, it crashes the app... I will try to research whats going on here, and where its crashing...
Anyone else getting diffrent results?
11/29/2002 (2:33 am)
Ok right now no matter what I include up there... string or memory I get the same result... No sky.A side note, when going to run Waterworld, it crashes the app... I will try to research whats going on here, and where its crashing...
Anyone else getting diffrent results?
#31
So this seems to complie fine then with the latest HEAD.. I dont get any errors.. I bet waterworld just has a screwy sky setup.... I will work on getting an example going here...
Thanks for the help..
BTW: No reason to feel sorry about this being messy. I'm just glad you decided to share it with us before your resource was approved... Can't wait to see this in action!!!!
11/29/2002 (2:36 am)
Just now saw your reply...So this seems to complie fine then with the latest HEAD.. I dont get any errors.. I bet waterworld just has a screwy sky setup.... I will work on getting an example going here...
Thanks for the help..
BTW: No reason to feel sorry about this being messy. I'm just glad you decided to share it with us before your resource was approved... Can't wait to see this in action!!!!
#32
-----------
day_0001
day_0002
day_0003
day_0004
day_0005
day_0006
day_0007
cloud1
cloud1
cloud1
-----------
Note that I don't render skyboxes anymore. And yes, I do have a reason for that ;)
11/29/2002 (2:38 am)
BTW, this is what your sky DML file should look like:-----------
day_0001
day_0002
day_0003
day_0004
day_0005
day_0006
day_0007
cloud1
cloud1
cloud1
-----------
Note that I don't render skyboxes anymore. And yes, I do have a reason for that ;)
#33
sky_day.dml (what waterworld uses) has:
day_0001
day_0002
day_0003
day_0004
day_0005
day_0006
day_0007
cloud1
cloud1
sky_sunset.dml dosent have any cloud1's in it at all(what I was using when it just showed no sky) dosent crash at all.
If I only use 1 cloud1, I get an error saying "(Invalid packet) You do not have the correct version of the Torque Game Engine or the related art needed to connect to this server, please contact the server operator to obatin the latest version of this game.
Do you think that it is the cloud1.png file itself?
11/29/2002 (3:21 am)
I made a sky_fractal.dml .. using what you said above.. that crashes. sky_day.dml (what waterworld uses) has:
day_0001
day_0002
day_0003
day_0004
day_0005
day_0006
day_0007
cloud1
cloud1
sky_sunset.dml dosent have any cloud1's in it at all(what I was using when it just showed no sky) dosent crash at all.
If I only use 1 cloud1, I get an error saying "(Invalid packet) You do not have the correct version of the Torque Game Engine or the related art needed to connect to this server, please contact the server operator to obatin the latest version of this game.
Do you think that it is the cloud1.png file itself?
#34
11/29/2002 (3:55 am)
I'll update to the latest head later today, drop in the sky.cc into it and check it out myself.
#35
12/01/2002 (7:09 pm)
I'm also crashing when I load waterworld and the test map. I havn't done much to figure out what it is. I am using the latest head (11/27 i think).
#36
So I decided to try to find a reason... my search led me to this line:
F32 sky1[256*256*3]; on generateFractal() and generateAlphaFractal()... for some reason that line is locking the game... lowering it to 256*256*2 on generateFractal() and 256*256 on generateAlphaFractal() fixed the problem BUT the sky doesnt look good anymore... hehehe, I spent hours trying to figure a way to make it work but no luck yet... so I decided to post it here, maybe someone else will know what to do with it :)
12/05/2002 (4:01 pm)
I've tried this on the latest head and Windows XP(replacing strings.h with string.h)... it crashed on waterworld as well... a better term would be hanged as it just stopped responding on the Loading Objects phase.So I decided to try to find a reason... my search led me to this line:
F32 sky1[256*256*3]; on generateFractal() and generateAlphaFractal()... for some reason that line is locking the game... lowering it to 256*256*2 on generateFractal() and 256*256 on generateAlphaFractal() fixed the problem BUT the sky doesnt look good anymore... hehehe, I spent hours trying to figure a way to make it work but no luck yet... so I decided to post it here, maybe someone else will know what to do with it :)
#37
12/05/2002 (10:29 pm)
Lowering the array size is a very bad idea, because you will corrupt other parts of the memory. - Hence the strange white blocks in the sky.
#38
Edit: Oh... Wait. YAY! changing sky1 to static seems to do the trick... it doesnt crash and looks good! :)
Are there any problems that might arise due to my change?
What I did was change
12/06/2002 (2:57 am)
Ya... but so far its the only way to stop the crash in my system... I really dont know why...Edit: Oh... Wait. YAY! changing sky1 to static seems to do the trick... it doesnt crash and looks good! :)
Are there any problems that might arise due to my change?
What I did was change
F32 sky1[256*256*3];to
static F32 sky1[256*256*3];on generateFractal() and generateAlphaFractal().
#39
12/06/2002 (3:28 am)
*That* should not cause problems, don't worry. However, I wonder what compiler you're using, because it looks weird to me that you have to declare that array static.
#40
12/06/2002 (3:31 am)
MS VC++ 6.0... heh..
Torque Owner Sam Guffey
If I set bool FractalSky = false; then it loads fine with the normal sky.
And where did you declare mNoRenderBans? Private, Public or what?