Board index DeFRaG Mapping

Question - Sky shader light generation

Maps and the process of creating them

Question - Sky shader light generation

Postby springy » Aug 5th, '20, 12:52 am

I've noticed that wherever there is a sky texture, it will generate light from ALL sky shaders being used anywhere in the map.

Example of problem:
Say you have a red sky, a blue sky, and a green sky all in one map but in completely separate rooms... You compile the map, and all three rooms have red blue and green light.

My goal is to use different sky textures in separate rooms and have each sky only give its own light to the room.

I've messed around with custom shaders a little bit with no luck, but I am a shader noob.

Does anybody know a solution?
TY
springy
 
Posts: 70
Joined: Aug 2nd, '11, 6:18 am

Re: Question - Sky shader light generation

Postby <)Ghost(> » Aug 5th, '20, 1:42 am

youre gonna have to create a new shader for each skybox with different lighting you want to use. Use DFWC2012-3 for example. in this specific area im using the same skybox
shot0584.jpg
but 2 different shaders for it, just to project the light in a certain direction. in the screenshot the one on the right is the custom shader.


Code: Select all
//changed q3map_sun settings from original mp_midnight skybox

textures/ghost-dfwc11/mp_midnight
{
   qer_editorimage env/mp_midnight/midnight-silence_ft.tga
   surfaceparm noimpact
   surfaceparm nolightmap
   q3map_globaltexture
   q3map_lightsubdivide 256
   q3map_surfacelight 200
   surfaceparm sky
   q3map_sun 1 1 1 250 270 50
   skyparms env/mp_midnight/midnight-silence - -
}


the original shader projects the sun straight down, i tweaked it so that its at an angle. i suggest you read the q3map(2?) shader manual. someone correct me its been years since ive done this. you can also adjust every other aspect of the sun itself. i think this should be obvious but you shouldnt be putting a huge box around the map.

:whistle:
You do not have the required permissions to view the files attached to this post.
<)Ghost(>
 
Posts: 347
Joined: May 2nd, '09, 3:19 pm

Re: Question - Sky shader light generation

Postby springy » Aug 5th, '20, 7:42 am

Thanks for the quick response :)

I flew around that dfwc map... Unfortunately I think its just showing a perfect example of the issue I'm having too. (Unless I'm misunderstanding something...)

As far as I can see there are 2 sky shaders used in the map:
1. mp_midnight original shader
2. custom mp_midnight shader with different sun angle

One sun angle is almost straight down, while the other is at an approx. 45 degree angle.

It seems like every sky surface in that map is generating 2 spots of light... regardless of which texture was used.

Here's the hallway:
room1.jpg


Each skyhole in that screenshot generates 2 light spots, one at a diagnol angle and one straight down.

The skyhole marked in red is in a vertical wall so it's straight-down light spot is hard to see, but you can still see the edge of it.

Here's two more rooms where its even more obvious that each sky hole generates the light from both shaders:
room2.jpg

room3.jpg



Normally its not a big issue, but I'm trying to use like 6 different skies In different areas...
The light from all 6 skies is being generated at any sky surface. It makes everything way to bright, oversaturated and washed out.

One solution I have tried is to make custom shaders for the 6 skies where I reduce their brightness to 1/6 of normal, so that the combined brightness everywhere is reasonable (about as bright as one normal sky)... this successfully reduces the brightness. But it still sucks because it means the lighting is blended from all sky shaders and the same everywhere. For example, you would expect expect a green sky to generate green light, not an amalgamation of green and 5 other colors...

In the same spirit you could just turn off light generation in some of the sky shaders, leaving it on in only 1 or 2 or them. This also doesn't solve the color problem...

I have found several ways to improve the situation by tweaking custom shaders, but I was wondering if there was a true way to have each sky surface only generate its own light...
You do not have the required permissions to view the files attached to this post.
springy
 
Posts: 70
Joined: Aug 2nd, '11, 6:18 am

Re: Question - Sky shader light generation

Postby skyhighguy » Aug 6th, '20, 3:03 am

discord would b a lot better for this spr
:p
skyhighguy
 
Posts: 116
Joined: Jul 19th, '14, 12:26 pm

Re: Question - Sky shader light generation

Postby <)Ghost(> » Aug 10th, '20, 7:50 pm

Damn I didn't even notice that. Or maybe I did at the time and just said fuck it. Sorry I can't be more helpful. This just might be a limitation of the q3 engine.
<)Ghost(>
 
Posts: 347
Joined: May 2nd, '09, 3:19 pm

Re: Question - Sky shader light generation

Postby springy » Aug 15th, '20, 5:56 pm

Yea ghost, it seems it might just be an inherent limitation. I haven't found any indication it can be done, I guess it's just gonna have to be some workaround for me...
springy
 
Posts: 70
Joined: Aug 2nd, '11, 6:18 am

Re: Question - Sky shader light generation

Postby Le another black niger » Aug 16th, '20, 6:15 pm

This is either bug or limitation of q3map2 (perhaps bug, as there was support of multiple skies mentioned in logs somewhere)
As problem affects q3map_sun and q3map_skylight only, q3map_surfacelight may be used instead.
Le another black niger
 
Posts: 392
Joined: May 17th, '11, 5:08 pm


cron