Tremulous Forum

Media => Mapping Center => Topic started by: nubcake on November 28, 2008, 04:53:07 pm

Title: Lens flares
Post by: nubcake on November 28, 2008, 04:53:07 pm
Hi guys, ive slightly modified the niveus shader file for the lens flare, and added it to my maps shader file. My question is what is the line to put under targetShaderName? Is it scripts/mymap.shader or textures/mymap/flare.TGA or something else? Because ive tried both of those and a few other combinations and none work. When I try the textures path it displays the lens flare texture but not the effect (a square box). When i point it to the actual shader file nothing happens. Any help?
Title: Re: Lens flares
Post by: Taiyo.uk on November 29, 2008, 05:09:12 pm
You need to use the name of the shader itself, not the .shader file or the .tga file. The flare entity uses the shader which in turn uses the .tga image.
Title: Re: Lens flares
Post by: nubcake on November 30, 2008, 07:51:15 am
So if the shader itself is called flare_red in the shaderfile mymap.shader would i have targetShaderName: flare_red because in another thread someone said use the full path (scripts/mymap/flare_red???)
Title: Re: Lens flares
Post by: Taiyo.uk on November 30, 2008, 12:49:31 pm
textures/mymap/flare_red
Title: Re: Lens flares
Post by: nubcake on November 30, 2008, 02:54:05 pm
Doesnt work :( This is what happens

(http://i530.photobucket.com/albums/dd342/prof_flex/failure.jpg)

Edit: I forgot to show that my targetShaderName was textures/mymap/flare and i also have the correct working script in my shaderlist, and it is also surrounded by a white outline in radiant (mean the shader is applied)
Title: Re: Lens flares
Post by: Taiyo.uk on November 30, 2008, 04:22:30 pm
Hmm, looks like it could be a shader issue, hath thou tried additive blending?

Code: [Select]
textures/mymap/flare_01
{
qer_editorimage textures/mymap/flare_01.jpg
surfaceparm nolightmap
surfaceparm nomarks
surfaceparm nonsolid
surfaceparm trans
cull disable
qer_trans 0.6
{
map textures/mymap/flare_01.jpg
blendfunc add
}
}
Title: Re: Lens flares
Post by: nubcake on November 30, 2008, 05:38:43 pm
Thats the same shader I use :'( I have no idea why it does it. Its not applying the shader at all.
Title: Re: Lens flares
Post by: Kaleo on December 02, 2008, 07:44:59 am
Are you using the texture with an alpha layer?

If you're not, I can't help, sorry. That's one of the few PhotoShop things I don't know how to do.
Title: Re: Lens flares
Post by: Odin on December 02, 2008, 06:46:42 pm
A texture with black as the background color will do fine if the blendFunc is add.
Title: Re: Lens flares
Post by: Kaleo on December 03, 2008, 12:35:46 am
Maybe try reworking the texture in PS or something. If you up the contrast, you should be able to make the black parts even more black. That might work.
Title: Re: Lens flares
Post by: seeeker on December 03, 2008, 07:50:14 am
with what i can see (on the screenshot) it doesnt need any altering, double check you are referencing the shader and not the image itself.
Title: Re: Lens flares
Post by: nubcake on December 03, 2008, 08:00:34 am
with what i can see (on the screenshot) it doesnt need any altering, double check you are referencing the shader and not the image itself.

I followed taiyos adive and tried textures/mymap/flare_red as i dont know the path to put in for the shader... I know where it is, and have tried scripts/myshader.shader but it doesnt work
Title: Re: Lens flares
Post by: Ingar on December 03, 2008, 07:00:49 pm
I assume you have a file called mymap.shader containing your shader script. Make sure you add mymap to shaderlist.txt.
Choose a name for the shader that differs from the texture name. There are situations were the wrong shader can be used
without you even noticing it.
Code: [Select]
textures/mymap/flare_01_s
{
        qer_editorimage textures/mymap/flare_01.jpg
...

Also, if you happen to have a .pk3 file that contains mymap.shader, move it outside your tremulous directory
when you are compiling and testing your map.