weird sky shader issue


(damocles) #1

I’m having one hell of a problem with my sky. It seems no matter what I do to the shader, the sky ALWAYS turns out completely black. This is the shader I though should work:


                     qer_editorimage textures/winterton/sky.jpg
	q3map_skylight 40 4
	q3map_sun 0.75 0.75 0.752 90 220 45	skyparms - 200 -
	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm sky
	surfaceparm fog
	fogparms ( 0.5 0.5 0.51 ) 3200
	{
		map textures/winterton/sky.jpg
		rgbGen const ( 0.5 0.5 0.51 ) 
	}

that turns out black - despite the sky.jpg file being light grey. So I tried a more extreme approach trying to at least see a difference:


                     qer_editorimage textures/winterton/sky.jpg
	surfaceparm noimpact
	{
		map textures/winterton/sky.jpg
		rgbGen const (1 1 1)
	}

Again, the result is a flat black sky. It’s driving me up the wall. I even tried all the SD sky shaders and each one of them shows up as plain black. What the hell is going on!?


(FireFly) #2

Just wondering, If you load up a stock map with the same et.exe you use for testing your maps are the skies still black?


(kamikazee) #3

@Firefly: Are you refering to the r_fastsky cvar?


(damocles) #4

Just wondering, If you load up a stock map with the same et.exe you use for testing your maps are the skies still black?

Everything is normal in every other way. No weird skies, no missing textures or anything. Just black skies in this map and any other map I compile. I’m thinking it might be something to do with the compile process - maybe something is being set that is causing the sky problem. Perhaps I’m using a deprecated shader command that is causing it?


(thore) #5

textures/fueldump/fueldumpsky (just to name one of the few) should definitely work, even with such a simple compile as BSP -meta.
If you’ve tried that shader and it turns out black I’d simply recommend reinstalling ET and Radiant (just because I don’t know what
can cause a working shader to appear all-black) and see if the prob survives this procedure.

Maybe you’re lucky and somebody has a somewhat smarter idea :wink:


(FireFly) #6

@Firefly: Are you refering to the r_fastsky cvar?

Yes, I must admit that I was, but I remembered that if r_fastsky is enabled the sky would not be pitch black. For example playing fueldump with r_fastsky on would result in a grey/blue-ish sky, not black…

Anyway,

I think I found the problem, It’s your shader causing it:

You used this line in your shader: " rgbGen const ( 0.5 0.5 0.51 ) "

This is causing the pitch black sky…

You also need to delete the line" fogparms (0.5 0.5 0.51) 3200 " or else you end up with a black-orange sky (missing texture)

If you delete both lines, your shader * should * work…


(damocles) #7

still black without the 2 lines. I really don’t know what the hell is going on here :frowning:


(FireFly) #8

Strange, well what I did was copy and paste the shader you posted to my own shaderlist. And ,just like you, I also got a pitch black sky… after I deleted both lines the shader works fine ingame with me.

here’s the shader I used, just to be sure:

textures/ronda_b2/damocles_test
{
	
	qer_editorimage textures/ronda_b2/ronda_sky.tga
	q3map_skylight 40 4
	q3map_sun 0.75 0.75 0.752 90 220 45 
	skyparms - 200 - 
	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm sky
	surfaceparm fog
	//fogparms (0.5 0.5 0.51) 3200
	{	
	map textures/ronda_b2/ronda_sky.tga
	//rgbGen const identityLighting
	
	}
}

You mentioned that the SD skies all work fine ingame. Try to copy for example the fueldump-shader and replace the lines “textures/skies/fueldump_clouds.tga” with your own texture (“textures/winterton/sky.jpg”)…
If that shader works ingame you can try to replace some of the other lines with your own and eventually can track down the line that is causing the black sky…

BTw: Do you get any shader/image errors ingame in the console?


(damocles) #9

hmm, making progress. Kinda. I copied and pasted your shader above (replacing the texture with my own) and now it’s HOM instead of black. I guess that’s something - at least it changed for once.

Still not really any wiser as to the fault. There are no console shader errors that relate to the sky shader - just a few model texture shaders and a few missing sounds.

Gonna have to feep fiddling around - something must be causing this :frowning:


(Detoeni) #10

//rgbGen const identityLighting

you cant have two rgbGen functions, only one will work.

surfaceparm fog

remove this as well, you should use worldspawn fog in ET, fog is also a volume flag, skys are not volumes.

you should also use sunExt as it gives much better lighting than sun.


(damocles) #11

I took thore’s advice above and tried the fuledump sky - one of the few SD skies I haven’t tried yet and that works. I get the fueldump clouds. However, if I try and change the fueldump clouds to another texture, I get…the fueldump clouds!?

At the moment, I’ve had to expand my skybox to a stupidly large area and let the fog volume/distance to opaque do the rest. I don’t really like this solution though as it’s a waste of performance drawing all that fogged sky. My shader as it stands now is:


                     qer_editorimage textures/winterton/sky.tga
	q3map_lightrgb 0.8 0.9 1.0
	q3map_skylight 85 4
	q3map_sun 1 .95 .9 200 210 28
	skyparms - 200 -
	surfaceparm nodlight
	surfaceparm noimpact
	surfaceparm nolightmap
	surfaceparm sky
	{
		map textures/winterton/sky.tga
		rgbGen identity
	}

This is just really bizarre. But I’ll keep on fiddling…


(damocles) #12

Weirder still - but it’s fixed!

I’m using the exact same shader as the one I just posted above, only I moved it into a different shader file and renamed the whole shader to match the name of the sky.tga file. Now it works. I’m sure it should be able to work the way it was before, but for whatever reason, it didn’t.

Thanks for your helps guys.