q on adding custom shader


(Digm) #1

I decided on using the “nightsky” texture that comes with Radiant, but unfortunately it didn’t come with a shader.

SO - after an hour of reading up on how to make a sky shader, and actually writing it, I came upon a discovery -

I don’t know where to put it, and I don’t know how to make it so the shader references the texture in Radiant (i.e. - comes up with white line outline automatically) :stuck_out_tongue:

help a brotha out!


(SCDS_reyalP) #2

This should be covered in the manuals, as well as many tutorials found in the sticky links.

In brief:
Assuming your shader is something like


textures/yourmapname/yourskyname
{
 .... shader stuff here...
}

the shader needs to be a file called yourmapname.shader
that .shader file goes in the scripts directory (in your etmain, and in the .pk3 when you make it)
a single line consisting of yourmapname goes into scripts/shaderlist.txt


(Digm) #3

Oof… I figured it out right after I posted. Although I still don’t quite know how I did it - it had more to do with the paths than the actual shader itself. I still get confused as to what the root of textures/skies/nightsky.tga actually is… so, as noobish as it sounds, I have a textures/skies in etmain/, etmain/maps/, and etmain/maps/mapname/ - one of them was right apparently :banghead:

But now I have a new question…

My qmap_sun intensity number doesn’t seem to have any effect on the textures. It lights & shadows my terrain, but not the buildings. It’s strange, because the terrain textures don’t have shader files yet either - so it’s not that. The q3map_surfacelight entry effects them, but not the intensity… any ideas?

thanks!


(sock) #4

The very top of your hard dirve in your computer is referred to as “C:” drive. (unless you got more than one logical drive partition) If you want to locate something on your hard drive, you would usually start at the top and work your way down. ET is very similiar except “\etmain” is the top of its tree instead. All other directories it uses is stored below “etmain”.

So the correct place for shaders is “etmain/scripts/myshader.script” and the texture in “etmain/textures/skies/nightsky.tga”. What makes this slightly confusing is that game does not need “etmain” in the path statements because it assumes this is always the top of its directory tree.

The intensity value is how strong your shadows will be from the sun. How sharp and black they will appear in your map.

Sock
:moo:


(Digm) #5

So the correct place for shaders is “etmain/scripts/myshader.script” and the texture in “etmain/textures/skies/nightsky.tga”. What makes this slightly confusing is that game does not need “etmain” in the path statements because it assumes this is always the top of its directory tree.

This cleared up all my confusion. It’s funny, because something so simple should be mentioned somewhere in a tutorial/manual - but I haven’t come across it once. Thanks!

The intensity value is how strong your shadows will be from the sun. How sharp and black they will appear in your map.

So does the sun only light terrain textures? Do building/model textures only get lit from light entities & surfacelight entries in the shader? I don’t even have shadows from the structures… they’re all 99% detail brushes, does that make a difference?


(Digm) #6

Just bumping this up since it hasn’t gotten any views in a couple days…

My textures are still black. Is this normal? Do textures only get lit via entities and surfacelights?