sky_color background -- no background - how?

Posted By: vertex

sky_color background -- no background - how? - 03/06/09 16:42

I'm using a good deal of template code. Among that code is display00.wdl.

I have some environments/levels that have solid color backgrounds and different interiors/levels that I want to have no background at all. This is for reasons of optimization. Removing the background helps a bit on interiors. (Fellow noobs, you'll no it's gone if you adjust the sky_color settings and you create a window in your interior and see an odd motion blur-like render effect. (The trick is to have no windows/views of the backgroiund.)
In display change skycolor to all 0s.
sky_color.red = 0;
sky_color.green = 0;
sky_color.blue = 0;


The problem is that display settings of the first level get carried over to other levels.

Help is appreciated.

Posted By: Michael_Schwarz

Re: sky_color background -- no background - how? - 03/06/09 19:10

set the sky color to something else when you load the new level.....
Posted By: vertex

Re: sky_color background -- no background - how? - 03/06/09 21:46

Thanks Michael.

"The problem is that display settings of the first level get carried over to other levels."

That is, I was doing exactly what you wrote already, but it isn't working.
I'm setting sky_color from a certain rgb (on the first level) to nothing (on a subsequent level).

If I load the no background level by itself without first loading the level with a solid sky color the sky color settings get set properly. Of course this isn't a solution when level switching is going on...


This appears true of other display settings as well, i.e. clip range. I need clip closer for some levels for optimization.

(Fellow noobs adjusting your clip and your background can greatly affect frame rate.)

Any help appreciated.

Thanks.
Posted By: Michael_Schwarz

Re: sky_color background -- no background - how? - 03/06/09 22:17

are you setting the new sky color after or before loading the new level? (e.g. before you invoke the level_load command)
Posted By: vertex

Re: sky_color background -- no background - how? - 03/06/09 23:08

Ok, thnks Michael. Before I was duplicating the display wdl and attempting to include a unique version of "display00.wdl" for each level by using "include" calling the modified nobackgrounddispaly00.wdl in each level's first script-- each level other than 2(the one that needs a solid sky). Doesn't work.

After your last response, I dusted off the unused portion of my artist brain and I took a look at "levels00.wdl" searching for the exit function. I found it, and inserted the sky_color to 0 settings... worked! but for one problem-- returning to the hub world (level2) which needs a solid sky, now loads first time to solid but of course on return from another level no background (not what I need) (because I've altered the exit function to do so).

The super complex solution algorithm that I created ... "if level2 don't do that"...

(I'm very new to programming). (level_num is a var pre setup in the template by its author. I am attempting to only give a solid sky on levle 2.
I'm getting several "parameter unknown errors" with my code below.
"parameter unknown-- keyword else bad parameter in {}
parameter unknown-- sky_color.red bad parameter in {}
...


The function Levels00_Exit_Pt_Event() is part of the template-- everything that follows is my addition and the rest is not included in my post.

My question now is what is wrong with this code:

function Levels00_Exit_Pt_Event()
{

if (level_num == 2)
{
// make a red one to test
sky_color.red = 100;
sky_color.green = 0;
sky_color.blue = 0;
} else // turn it off for optimization
{ sky_color.red=0;
sky_color.green = 0;
sky_color.blue = 0;
}
....

Thanks.
Posted By: vertex

Re: sky_color background -- no background - how? - 03/09/09 14:16

Still need help on this if anyone can do so.

I thought I had it taken care of using some work arounds-- but not really-- need to change background sky color between levels.

Thnx.

© 2023 lite-C Forums