lfnetwork.com mark read register faq members calendar

Thread: Pulsating shader {again}
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 05-21-2003, 01:38 AM   #1
fattysbox
 
fattysbox's Avatar
 
Join Date: Apr 2003
Posts: 67
Pulsating shader {again}

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
fattysbox is offline   you may: quote & reply,
Old 05-21-2003, 03:41 AM   #2
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
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.
lassev is offline   you may: quote & reply,
Old 05-21-2003, 11:41 AM   #3
fattysbox
 
fattysbox's Avatar
 
Join Date: Apr 2003
Posts: 67
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????

fattysbox is offline   you may: quote & reply,
Old 05-21-2003, 01:20 PM   #4
Obsidian-Jovani
 
Obsidian-Jovani's Avatar
 
Join Date: Apr 2003
Location: Onderon
Posts: 223
Quote:
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.


Binary Sunset Studios

WIP: A SP Project entitled "Resurgence"
Obsidian-Jovani is offline   you may: quote & reply,
Old 05-21-2003, 02:11 PM   #5
wedge2211
Commander, Rogue Squadron
 
wedge2211's Avatar
 
Join Date: Jul 2002
Location: Ithaca, NY
Posts: 2,320
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.


wedge2211 is offline   you may: quote & reply,
Old 05-21-2003, 04:43 PM   #6
fattysbox
 
fattysbox's Avatar
 
Join Date: Apr 2003
Posts: 67
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...
fattysbox is offline   you may: quote & reply,
Old 05-21-2003, 09:19 PM   #7
lauser
 
lauser's Avatar
 
Join Date: Jan 2003
Location: CANADA
Posts: 428
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.


My kung fu is also very weak
lauser is offline   you may: quote & reply,
Old 05-21-2003, 09:23 PM   #8
lauser
 
lauser's Avatar
 
Join Date: Jan 2003
Location: CANADA
Posts: 428
I forgot to mention that when you want go to save the changes in your NEW shader file ---> save as (filename).shader . So my file name is for example tallania.shader. Voila!!


My kung fu is also very weak
lauser is offline   you may: quote & reply,
Old 05-22-2003, 03:39 AM   #9
lassev
cryptoscripter
 
lassev's Avatar
 
Join Date: Jun 2002
Location: Finland
Posts: 1,087
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
lassev is offline   you may: quote & reply,
Old 05-22-2003, 02:36 PM   #10
fattysbox
 
fattysbox's Avatar
 
Join Date: Apr 2003
Posts: 67
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!!
fattysbox is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JO Mapping > Pulsating shader {again}

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:30 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.