i try to learn shaders ...


(isbowhten) #1

isnt that a useful water shader? (it does not work. i do not knwo why)

textures/saberpeak_terrain/sp_mediumwater
{
//qer_editorimage textures/saberpeak/saberpeak_terrain/sp_mediumwater.tga
qer_trans 0.35
cull disable
surfaceparm nonsolid
surfaceparm water
surfaceparm trans
}
i also tried a shader
with surfaceparm nonsolie only and it was solid… so i suppose that the shader isnt loaded cause of a wrong path or anything like that…


(Zer0Cool) #2
  1. did you add it to your shaderlist?
  2. on how many sides of the brush did you add the shader?

http://planetquake.ingame.de/tutorials/shadermanager.php


(Pray-N-Spray) #3

What are those 2 “//” there?

And did you try to put the texture in other folder and edit the shader?


(isbowhten) #4

well … i read a big manual but i cant speak english very well…
those // are comments like in scripting or C++ …
putting the texture in another folder and edit the shader should not affect anything… did not try it.

zer0cool . ehh…
i do not knwo how to use a shader ^^
from your question i think i figure out that the shader doesnt have any effect if i do Shift+Mouse1… set to l the brush the sp_mediumwater TEXTURE and add a shader for it…
doesnt that work?
so what i mean is:
can i set a TEXTURE and write a shader for it? or do i have to drag my shader IN radiant onto the brush?


(Avoc) #5

You cannot apply that shader to all the sides of the brush you want to make water.

open the liquid_sd.shader and there should be a “siwa_water_nodraw” or something. Apply that texture to ALL of the sides of the brush EXCEPT the top face. The top face should have your texture applied.


(isbowhten) #6

i havent a usual water… if i understood you correct…
i shall put e.g. the common/nodrawwater texture on the brush and the top face has a texture… now i see from above the texture AND can swim in the brush… but in my unusual water i would have to set a texture to all surfaces…
what i want is nodrawwater which is not nodrawn but drawn…xD
AND i want to learn shaders => i do not use liquid_sd.shader

edit:
i tried to load my shader in radiant… the “folder” like common (in my case onslaught) exists !
but 0 shaders and 0 textures loaded …


(sQynor) #7
textures/saberpeak_terrain/sp_mediumwater_shader
{
	qer_editorimage textures/saberpeak/saberpeak_terrain/sp_mediumwater.tga
	qer_trans 0.35
	cull disable
	surfaceparm nonsolid
	surfaceparm water
	surfaceparm trans
	{
		textures/saberpeak/saberpeak_terrain/sp_mediumwater.tga 
	}
}

Try that. then add the name to the shaderlist.txt open GTK radiant press T go to option Flush & reload shaders.

Go to the map Saberpeak_terrain and look for a texture called sp_mediumwater_shader

I couldn’t get shaders to work either because i selected the texture instead of the shader. so this has to work :slight_smile:

good luck and enjoy :slight_smile:

:smiley:

For further questions you can allways PM me :slight_smile:

Well i’ll explain you a little bit about your shader.

textures/saberpeak_terrain/sp_mediumwater_shader <-- this here is the name of the shader you use in gtk radiant
{
qer_editorimage textures/saberpeak/saberpeak_terrain/sp_mediumwater.tga <-- this here is the image it uses in radiant so you can click on it. most of the time it’s the texture you want to use.
qer_trans 0.35 <-- this makes your shader transparent in radiant
cull disable <-- cull disabled
surfaceparm nonsolid <-- this makes it nonsolid
surfaceparm water <-- this makes it water
surfaceparm trans <-- and this transparent
{
textures/saberpeak/saberpeak_terrain/sp_mediumwater.tga <-- the texture it has to use
}
}


(isbowhten) #8

thanks… will try it tomorrow… cause now it is too late for me . i have school tomorrow


(isbowhten) #9

now in radiant my water was displayed transparent … but in the game ( hosted the pk3 ) the textures are missing.


(Pray-N-Spray) #10

Did you add the shader in shaderlist?


(isbowhten) #11

yes i added it off course.
in radiant the not-transparent saberpeak texture is shown Transparent now !!! but on a host the textures are missing… (i think i do not need a shaderlist in a pk3 do i?)
edit: and i recompiled !


(sQynor) #12

the texture you use. like in the .shader you use the saberpeak water. you have to use it again. so u have to copy the texture and place it in your .pk3 else it doesn’t work.


(isbowhten) #13

off course ALL textures are in the pk3 :wink:
i can upload it …
edit: http://www.speedyshare.com/623241526.html


(Zer0Cool) #14

textures/saberpeak_terrain/sp_mediumwater_shader
{
qer_editorimage textures/saberpeak/saberpeak_terrain/sp_mediumwater.tga
qer_trans 0.35
cull disable
surfaceparm nonsolid
surfaceparm water
surfaceparm trans
{
map textures/saberpeak/saberpeak_terrain/sp_mediumwater.tga
}
}

i gave you the link for a good german shader manual. use it.

i can just recommend to use your own paths like textures/nameofyourproject/nameofyourshader


(isbowhten) #15

no textures ae displayed but the shader does not have any effect on them… ??? what did i wrong??
lol… i dont need to know the commandas how i can do some stuff wiht shaders… it only does not do anything


(Zer0Cool) #16

Sorry I do not understand what you mean. I added the “map” as I showed you and i tested your shader in an own map and it worked fine for me.


(isbowhten) #17

in radiant the water looks transperent… but in et it first showed the orange-black texture-missing texture … and after adding “map” the textures were displayed but NOT transparent as if i had not written a shader… can you upload your pk3 the shader worked?


(Zer0Cool) #18

As i tested your shader i didnt look for the transparency, sorry.
AFAIK you have to tell the shader it has to use the alphachannel.

textures/saberpeak_terrain/sp_mediumwater
{
	qer_editorimage textures/saberpeak_terrain/sp_mediumwater.tga
	qer_trans 0.35
	cull disable
	//surfaceparm nonsolid    <-  AFAIK not necessary because water is nonsolid anyway 
	surfaceparm water
	surfaceparm trans
	{
		map textures/saberpeak_terrain/sp_mediumwater.tga 
        blendFunc GL_DST_COLOR GL_SRC_COLOR  //   <- tells it to use the alphachannel, there are different commands for that, i am no pro in this, mayby someone else can explain better, or you try to understand from shadermanual
	}
}

(isbowhten) #19

hmm… but when i tested it it was not nonsolid too. … it was solid … had nothing to do with water …

edit: with that alpha channel thing it is transparten but it is still SOLID !!! i cant swim in the water


(Zer0Cool) #20

did you add it to all sides of the brush?
or did you add to the other sides the common nodrawwater shader?