Author Topic: Lens flares  (Read 5231 times)

nubcake

  • Posts: 529
  • Turrets: +49/-85
Lens flares
« 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?

Taiyo.uk

  • Posts: 2309
  • Turrets: +222/-191
    • Haos Redro
Re: Lens flares
« Reply #1 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.

nubcake

  • Posts: 529
  • Turrets: +49/-85
Re: Lens flares
« Reply #2 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???)

Taiyo.uk

  • Posts: 2309
  • Turrets: +222/-191
    • Haos Redro
Re: Lens flares
« Reply #3 on: November 30, 2008, 12:49:31 pm »
textures/mymap/flare_red

nubcake

  • Posts: 529
  • Turrets: +49/-85
Re: Lens flares
« Reply #4 on: November 30, 2008, 02:54:05 pm »
Doesnt work :( This is what happens



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)
« Last Edit: November 30, 2008, 02:55:37 pm by nubcake »

Taiyo.uk

  • Posts: 2309
  • Turrets: +222/-191
    • Haos Redro
Re: Lens flares
« Reply #5 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
}
}

nubcake

  • Posts: 529
  • Turrets: +49/-85
Re: Lens flares
« Reply #6 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.

Kaleo

  • Posts: 2098
  • Turrets: +176/-220
    • KaleoDesign
Re: Lens flares
« Reply #7 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.
Quote from: Stannum
Thou canst not kill that which doth not live,
but you can blow it into chunky kibbles!
I has a cookie, and u can has a cookie, but i no givs u mai cookie...

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Re: Lens flares
« Reply #8 on: December 02, 2008, 06:46:42 pm »
A texture with black as the background color will do fine if the blendFunc is add.

Kaleo

  • Posts: 2098
  • Turrets: +176/-220
    • KaleoDesign
Re: Lens flares
« Reply #9 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.
Quote from: Stannum
Thou canst not kill that which doth not live,
but you can blow it into chunky kibbles!
I has a cookie, and u can has a cookie, but i no givs u mai cookie...

seeeker

  • Posts: 122
  • Turrets: +19/-5
Re: Lens flares
« Reply #10 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.

nubcake

  • Posts: 529
  • Turrets: +49/-85
Re: Lens flares
« Reply #11 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

Ingar

  • Tremulous Developers
  • *
  • Posts: 554
  • Turrets: +302/-7
    • Ingar's projects on the Web
Re: Lens flares
« Reply #12 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.