Jump to content

Home

Pulsating shader {again}


fattysbox

Recommended Posts

Hey guys,

 

I want to make this shader pulsate:

 

textures/nar_hideout/lightshaft

{

{

map $lightmap

}

{

map textures/nar_hideout/lightshaft

blendFunc GL_DST_COLOR GL_ZERO

}

{

map textures/nar_hideout/lightshaft_glow

blendFunc GL_ONE GL_ONE

}

}

 

In another thread, wedge suggested rgbGenwave 0 1 0 2??

Is this the right idea? And if it is, where should I place it in the code... Yes, I am going through the Shader Manaul, but man is it slow going!! ;)

 

Thanks

Link to comment
Share on other sites

You know, to make good looking shaders, or even close to stunning shaders, you don't really need to understand fully how the shader code works. Of course it helps, but it's not necessary, and generally if you are making a big, detailed map with custom textures you could spend your time more sagely by learning at first only the essential parts.

 

What I mean is that you open some existing shader file, like imperial shader, in ShaderED, and go through the shader previews so long you find a right looking pulsating shader. Then you open the file in Notepad and use the search function to find the code. Then just copy the relevant part to your own shader file, replace file names, and voila!

 

You can easily adjust the pulse rate and other settings in ShaderED, because you see almost right away the effect of changes.

 

Oh yeah, and rgbGenwave belongs in league with the _glow part of your shader.

Link to comment
Share on other sites

Thanks that explains much.

 

BUT, I tried to oped ShaderED and a respective shader file, and every shader in that file came up with an error... Here it is:

 

Bad file format (the shader)

owned by (the shader)

couldn't read shader

continue recieving the message?

 

I hit yes for each and every shader. When I go to view a shader, it gives me an error check of !!!!!!2!!!!!! (which is flashing) and that tells me that stage2 and stage3 file has not been found...

 

Can anyone tell me what the heck that means????

 

:confused: :confused: :cheers::confused: :confused:

Link to comment
Share on other sites

Originally posted by fattysbox

Thanks that explains much.

 

BUT, I tried to oped ShaderED and a respective shader file, and every shader in that file came up with an error... Here it is:

 

Bad file format (the shader)

owned by (the shader)

couldn't read shader

continue recieving the message?

 

I think, but don't hold me to it, that this means it is not finding the textures that the shader uses. Did you extract the textures folder from assests0.pk3? If not, try that to see if that works.

Link to comment
Share on other sites

ShaderED is wierd. Much better to muck around with the actual code in Notepad.

 

As lassev suggested, open up a game shader that you KNWO pulsates. Look at the structure of the thing: there will be a section where various surfaceparms are defined, then a { map } block for every image that is displayed on the shader, and the pulsating one will include the rgbGen line in the { map } block that pulsates. So, if you want to make a shader that looks line a flat panel wil pulsating lights on it, you make a panel image and a glow image and then make some code like this:

 

pulsating_glowing_shader

{

 

surfaceparms

{

map panel_image

}

{

map glow_image

rgbGen wave <params>

}

 

}

 

Check the q3a shader manual for details on the rgbGen statement, the shader manual comes with GtkRadiant (look in...the Q3A Shader Manual folder!) I think the statement is written rgbGen <func> <base> <amplitude> <phase> <frequency>, you probably want func "wave," base 0, amp 1, phase 0, and frequency whatever the frequency of the pulses are, in pulses per second.

Link to comment
Share on other sites

It makes sense to extract them from the assets0 file, which I did. However, I still get the same results as mentioned above...

 

Any ideas? I think the ShaderED program would be useful in learning how to change the code if I could only see the shader. Of course I could just go into the game itself, knock off some troopers till I see a pulsating shader...

 

OH well, thanks, I'm gonna try putting the rgbGen wave function in anyways...

 

But another question: If I alter the shader in notepad, it probrably will be altered in JO, I mean the actually game, not a map I created? I guess I would have to save a new shader file? If that is true, how do I direct JO to use my shader in my maps, but the original shader in the regular maps...

 

Each question answered (well hopefully) brings up 5 more questions...

Link to comment
Share on other sites

LOL!! Yeah here is my idea.....Listen to Wedge. Every other great mapper uses notepad to change shaders or put a shader in there map. Shader Ed. bites. Many others have the same problem and can't get it to work. Stick with notepad.:D

Link to comment
Share on other sites

Indeed. I don't actually promote the use of ShaderED. I simply use it for preview, because my imagination is so lacking that I cannot actually see the shader in life in Notepad...

 

But in a case similar to this I have used ShaderEd (with success) to adjust the base, phase and frequency of glow pulse. Of course the shader itself was done in Notepad before that.

 

And the game will use any shader in any shader file, if that shader is used in Radiant to texture a brush in your map. You should always give custom names to your shaders (not only shader files), as lauser suggested, rather than use the name you get by copying the existing shader code for your own use. You don't want to deal other people your own version of bespin shader file, but your personal mymapshaders file.

 

Oh, and answer NO to that question ShaderED is asking you :)

Link to comment
Share on other sites

Thanks, well that makes much sense I suppose...

 

But even reading the Q3A manual on shader code doesn't help that much. What is really needed is a tutorial on shaders. I mean looking at other maps and seeing all of the different shaders people have created, I can't wait to learn this crap because I'm getting serious into mapping...

 

BTW, I put rgbGen wave <parms> right after glow_image line and nothin' happened...

 

Trial and error is going to take a long time!! :D

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...