Author Topic: Help with light shaders. [SOLVED]  (Read 10237 times)

Shifty

  • Posts: 75
  • Turrets: +0/-0
Help with light shaders. [SOLVED]
« on: November 05, 2010, 10:14:28 am »
I would like to make a simple shader which was white in game and gave of light similar to a fluorescent light perhaps. I've tried copying existing ones and alsort but none seem to work. Can anyone give me a hand on what is required and such? I use a fairly recent version of Net Radiant on Windows Xp just in case that's important.

Thanks.
« Last Edit: November 06, 2010, 05:56:29 am by Shifty »

Knowitall66

  • Posts: 492
  • Turrets: +70/-52
Re: Help with light shaders.
« Reply #1 on: November 05, 2010, 12:12:15 pm »
Make sure you set up the shader properly;
- Add the name of your shader file to 'shaderlist.txt', then open Radiant (Or Refresh Shaders in Texture Browser).
- In Radiant your shader should have a white outline around it in the Texture Browser, if not you've done something wrong.

Make sure you compile with a light stage.

c4

  • Posts: 554
  • Turrets: +9/-22
Re: Help with light shaders.
« Reply #2 on: November 05, 2010, 12:36:48 pm »
I would like to make a simple shader which was white in game and gave of light similar to a fluorescent light perhaps. I've tried copying existing ones and alsort but none seem to work. Can anyone give me a hand on what is required and such? I use a fairly recent version of Net Radiant on Windows Xp just in case that's important.

Thanks.

Alternatively, find a default shader and apply it to your surface.
eh, i prefer gregorian.net chat better than this. NO download and its LIVE!
 :basilisk: FTW![wiki]basilisk[/wiki]

Plague Bringer

  • Posts: 3815
  • Turrets: +147/-187
Re: Help with light shaders.
« Reply #3 on: November 05, 2010, 07:02:17 pm »
I would like to make a simple shader which was white in game and gave of light similar to a fluorescent light perhaps. I've tried copying existing ones and alsort but none seem to work. Can anyone give me a hand on what is required and such? I use a fairly recent version of Net Radiant on Windows Xp just in case that's important.

Thanks.

Alternatively, find a default shader and apply it to your surface.
Or we could not suggest the easy way out to one of the few mappers that seems to want to learn something new.  ::)
U R A Q T

c4

  • Posts: 554
  • Turrets: +9/-22
Re: Help with light shaders.
« Reply #4 on: November 05, 2010, 07:18:15 pm »
I would like to make a simple shader which was white in game and gave of light similar to a fluorescent light perhaps. I've tried copying existing ones and alsort but none seem to work. Can anyone give me a hand on what is required and such? I use a fairly recent version of Net Radiant on Windows Xp just in case that's important.

Thanks.

Alternatively, find a default shader and apply it to your surface.


Or we could not suggest the easy way out to one of the few mappers that seems to want to learn something new.  ::)

It's still pretty hard though.  You actually have to apply the shader to the surface.
eh, i prefer gregorian.net chat better than this. NO download and its LIVE!
 :basilisk: FTW![wiki]basilisk[/wiki]

Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Help with light shaders.
« Reply #5 on: November 05, 2010, 11:38:44 pm »
Ok, well I'll try again with the shaderlist.txt advice but I think I've tried that already.

I would copy map textures but as a map modder (visual texture modding) I have found it to be rather irritating when a map uses another's textures so ideally I would like all the textures to be part of the maps .pk3. This means I need to make/remake several shaders, which I'm still trying to learn how to do.

Thanks for the comments so far though, if you have any other suggestions I'd love to hear them :D

Knowitall66

  • Posts: 492
  • Turrets: +70/-52
Re: Help with light shaders.
« Reply #6 on: November 05, 2010, 11:57:21 pm »
Ok, well I'll try again with the shaderlist.txt advice but I think I've tried that already.

I would copy map textures but as a map modder (visual texture modding) I have found it to be rather irritating when a map uses another's textures so ideally I would like all the textures to be part of the maps .pk3. This means I need to make/remake several shaders, which I'm still trying to learn how to do.

Thanks for the comments so far though, if you have any other suggestions I'd love to hear them :D
I would suggest you don't do that, some Mappers (Level Designers) would not appreciate you altering their work (Ask for permission first). Furthermore if you want alter the lighting in a map, just changing the shader will not work. You'd need to recompile the BSP.

Oh, and the reason I (and other Mappers (Level Designers)) use textures from the Default Maps, is because if I (/we) didn't then my (/our) pk3s would be too big for people to download (Especially if their downloading them in game).
« Last Edit: November 05, 2010, 11:59:25 pm by Knowitall66 »

Plague Bringer

  • Posts: 3815
  • Turrets: +147/-187
Re: Help with light shaders.
« Reply #7 on: November 06, 2010, 12:35:20 am »
I would suggest you don't do that, some Mappers (Level Designers) would not appreciate you altering their work (Ask for permission first). Furthermore if you want alter the lighting in a map, just changing the shader will not work. You'd need to recompile the BSP.
Far as I know, all textures released for Q3 are allowed to be edited freely without permission. That'd make asking permission simply a nice gesture. That being said, though, many mappers will happily let you customize as much as you want. Those who don't are, in my opinion, rather stingy about their work. I'll reread some source later and see if I can cite the legality issue. I think textures are licensed under Creative Commons?
U R A Q T

Knowitall66

  • Posts: 492
  • Turrets: +70/-52
Re: Help with light shaders.
« Reply #8 on: November 06, 2010, 12:54:10 am »
I would suggest you don't do that, some Mappers (Level Designers) would not appreciate you altering their work (Ask for permission first). Furthermore if you want alter the lighting in a map, just changing the shader will not work. You'd need to recompile the BSP.
Far as I know, all textures released for Q3 are allowed to be edited freely without permission. That'd make asking permission simply a nice gesture. That being said, though, many mappers will happily let you customize as much as you want. Those who don't are, in my opinion, rather stingy about their work. I'll reread some source later and see if I can cite the legality issue. I think textures are licensed under Creative Commons?

A gesture greatly appreciated (I'd rather not see all the textures in a map made 'seizure inducing').
In regards to licensing, there are a few packs that do not allow any alteration what so ever. (For example; 'Mr Cleans' texture sets, 'Mr.LyCon' 'NeoTech' texture set)
'EvilLair's texture sets are also not allowed to be altered as per the licensing (http://creativecommons.org/licenses/by-nc-nd/3.0/).
« Last Edit: November 06, 2010, 01:05:38 am by Knowitall66 »

Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Help with light shaders.
« Reply #9 on: November 06, 2010, 05:11:53 am »
Duely noted. I would make simple default map re skins like atcs and found people complained because the different textures looked out of place when used in other maps. Please note I didn't edit the textures, I remade them, example here That also shows screenshots of the textures in other maps, which is what I mean. But I have stopped that now that I can map ^^. However that is not the point.

Im making a new map, b2 of my first and only map so far (click image for link to release site thingy)


As you can see there are a lot of fluorescent lights, each of which uses 3 light entities and is a big pain. In b2 I am redoing it all and resizing it to be bigger and I would like to use a shader for the white part of the lights. So basically all I need is the code to put in the shader file for the map...or a tutorial link or something. I have googled it and such but found nothing helpful.

Thanks again.

UPDATE:
Ok so I got it working, not really sure what I was doing wrong, but here's the script for the shader file:

textures/axon/whitelight
{
   surfaceparm nomarks
   q3map_surfacelight 1000
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/axon/whitelight.tga
      blendFunc GL_DST_COLOR GL_ZERO
      rgbGen identity
   }
   {
      map textures/axon/whitelight
      rgbGen wave sin 1.0 1.0 1.0   
      blendfunc GL_ONE GL_ONE
   }
}

(I will ramp up the brightness now I got it working)


Thanks guys.
« Last Edit: November 06, 2010, 05:42:52 am by Shifty »

Knowitall66

  • Posts: 492
  • Turrets: +70/-52
Re: Help with light shaders.
« Reply #10 on: November 06, 2010, 05:50:36 am »
...
   {
      map textures/axon/whitelight
      rgbGen wave sin 1.0 1.0 1.0  
      blendfunc GL_ONE GL_ONE
   }
...

I'm pretty sure you don't need that shader stage.

Oh, and if it's all working then please add '[SOLVED]' to the threads title.

Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Help with light shaders.
« Reply #11 on: November 06, 2010, 05:55:27 am »
Sure thing.

Im going to keep that there so it can easily be copied if I want different colours.

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Re: Help with light shaders. [SOLVED]
« Reply #12 on: November 06, 2010, 09:10:34 am »
Just use the $whiteimage builtin.

Code: [Select]
textures/axon/whitelight
{
   q3map_surfacelight 1000
   surfaceparm nomarks
   surfaceparm nolightmap // skip lightmap generation as it's wasteful here.
   {
      map $whiteimage
      // add 'rgbGen const ( redvalue greenvalue bluevalue )' to change the color from white.
   }
}
« Last Edit: November 06, 2010, 09:12:45 am by Odin »

Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Help with light shaders. [SOLVED]
« Reply #13 on: November 06, 2010, 11:23:57 am »
Lol, can anyone explain what it all means? Im just copying and editing till it works.

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Re: Help with light shaders. [SOLVED]
« Reply #14 on: November 06, 2010, 10:53:17 pm »
Lol, can anyone explain what it all means? Im just copying and editing till it works.
Sure.
Code: [Select]
textures/axon/whitelight                                // name of the shader
{                                                       // begin shader
   q3map_surfacelight 1000                              // emit light during the q3map2 -light stage to add light to surrounding lightmaps
   surfaceparm nomarks                                  // prevent mark decals from appearing(when the surface is shot, etc)
   surfaceparm nolightmap                               // skip lightmap generation (for the surface this shader is on) as it's wasteful here.
   {                                                    // begin shader image stage
      map $whiteimage                                   // map plain white pixels to the surface(the $ denotes a built-in image in the engine)
      // rgbGen const ( redvalue greenvalue bluevalue ) // remove the '//' before 'rgbGen to change the color from white.
   }                                                    // end shader image stage
}                                                       // end shader
« Last Edit: November 06, 2010, 10:56:08 pm by Odin »

Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Help with light shaders. [SOLVED]
« Reply #15 on: November 07, 2010, 08:35:18 am »
 :D Thankyou.

CATAHA

  • Posts: 539
  • Turrets: +8/-18
    • Tremulous Lair
Re: Help with light shaders. [SOLVED]
« Reply #16 on: November 07, 2010, 12:34:45 pm »
All this with detailed help you can read in Shaders Manual. Dont be lazy, lol.
Russian q3/trem mapping site: http://tremlair.krond.ru/
=[ Boxmaps suck if they have no concept ]=

Ice Trap (InstaGib)

Other maps: A.T.D*S Remake

Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Help with light shaders. [SOLVED]
« Reply #17 on: November 08, 2010, 09:56:20 am »
Shaders Manual? Im more than happy to read one if there is one. Where/what is it?

Knowitall66

  • Posts: 492
  • Turrets: +70/-52
Re: Help with light shaders. [SOLVED]
« Reply #18 on: November 08, 2010, 10:41:42 am »
It's listed in the 'Useful Mapping Links' thread, stickied at the top of this forum.

CATAHA

  • Posts: 539
  • Turrets: +8/-18
    • Tremulous Lair
Re: Help with light shaders. [SOLVED]
« Reply #19 on: November 08, 2010, 02:15:36 pm »
You can just type 'shader manual' in Google. But if you so damn lazy, then, for example, try this: http://www.robotrenegade.com/q3map2/docs/shader_manual/
Russian q3/trem mapping site: http://tremlair.krond.ru/
=[ Boxmaps suck if they have no concept ]=

Ice Trap (InstaGib)

Other maps: A.T.D*S Remake

Shifty

  • Posts: 75
  • Turrets: +0/-0
Re: Help with light shaders. [SOLVED]
« Reply #20 on: November 15, 2010, 08:01:38 pm »
Well iiiiiiiiiiim sorry..shesh, I just didnt think there would be such a thing.