shaders


(Bobb) #1

does anyone have a good explanation about shaders or a link? need to know the basics to make a shader (want to make ice which if u fall on u dont get hurt but the ice still slides) :wink: :wink:


(kamikazee) #2

Seek for Obsidian’s shader manual mirror.
It contains all statements to use in a shader script.

I haven’t got any examples on writing shaders neither, try searching Google for those.


(Shaderman) #3

Mirrored Shader Manual

want to make ice which if u fall on u dont get hurt

You’ll need surfaceparm nodamage for that in your shader.


(Bobb) #4

do u need to have the texture in ur pk3 or?


(kamikazee) #5

If you’re using images, they don’t need to be in your pk3 as long as they are in pak0.pk3.
Your shader must be included, of course.


(Bobb) #6

i put this in my shader file and put it into scripts in the pk3 but it doesnt work :slight_smile: anything wrong about this?
textures/Bobb/icelake2_opaque2:q3map
{
surfaceparm nodamage
surfaceparm slick
}


(kamikazee) #7

Does “textures/Bobb/icelake2_opaque2” exist?
If it’s a custom texture, you got to include it as I said.


(Shaderman) #8

Looking at existing ice shaders (fueldump for example) could help :wink:


(Bobb) #9

im trying atm :slight_smile:


(Bobb) #10

lol it still doesnt work :confused: wtf is wrong a bout this then?

Bobbsaland_b4.shader:

textures/Bobbsaland_b4/icelake2_opaque2
{
qer_trans 0.95
qer_editorimage textures/Bobbsaland_b4/icelake2_opaque2.tga
sort seethrough
surfaceparm slick
surfaceparm nodamage
surfaceparm glass

{
	map textures/Bobbsaland_b4/icelake2_opaque2.tga
	blendfunc filter
}

}

???


(Shaderman) #11

What exactly doesn’t work?


(Bobb) #12

u dont slide on the ice and u get damage when u fall on it


(Shaderman) #13

The last shader you posted looks good and should work IMO (not sure about the sort seethrough line though). Rename the shader to something else (textures/Bobbsaland_b4/icelake2_test for example) and be sure you apply this renamed shader to your brushes. Does it work now?


(Bobb) #14

euhm i put the scripts and textures in a pk3, then loaded it and put it in my map, then put the same shader textures arena map in my .pk3 , loaded it, i saw that the ice was a bit transparent but it doesnt slide or stop damage ;/ but the shader must be half working cuz i see it transparent


(CooperHawkes) #15

did you recompile the map?


(Bobb) #16

yeah but i dont know why the nodamage and slick doesnt work and the transparent does?


(nUllSkillZ) #17

Not sure just an idea.
Try to name your shader different then your texture (TGA).


(Shaderman) #18

That’s what I suggested above :slight_smile:


(CooperHawkes) #19

That’s why i asked for the recompile… changes in one of the shader stages (e.g. transparency) are adopted instantly, i.e. without a recompile.
Changes in surfaceparam flags need a recompile… are you sure, et loads the new bsp? maybe there is an old version still in one of the pk3 files.