Quake3World.com Forums
     Level Editing & Modeling
        How to Create a Surface LIght


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: How to Create a Surface LIght

Recruit
Recruit
Joined: 26 Feb 2017
Posts: 4
PostPosted: 02-26-2017 09:55 AM           Profile Send private message  E-mail  Edit post Reply with quote


I have been trying for a week now to make a custom surface light shader with GTKRadiant 1.6.5.

I have noticed that surface light shaders such as textures/base_light/ceil_white5k from pak0.pak work just fine. However, when I try to make a surface light that follows the same patteren it just failes to emit light and only shows up as a regular, non-light emitting, texture.

For example here is the shader for textures/base_light/ceil_white5k:

textures/base_light/ceil_white5k as extracted from pak0.pak:

textures/base_light/ceil_white5k
{
qer_editorimage textures/base_light/ceil1_38.tga
surfaceparm nomarks
q3map_surfacelight 5000
{
map $lightmap
rgbGen identity
}
{
map textures/base_light/ceil1_38.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/base_light/ceil1_38.blend.tga
blendfunc GL_ONE GL_ONE
}
}

Now if I even copy that one verbatim changing only the paths to the shader text and image files, all I get is a regular texture displayed on a non-light emitting brush.

Here's a screen shot from Wolfcam it does the same thing in ioquake of a brush covered with a copy of the above shader extracted from the pk0.pak given a different name and put into the base sripts and texture folders.

As you can see the texture shows up fine although there is an absence of any emitted light from the surface of the brush to illuminate the small room I have it in.

Any help would be appreciated.

BTW Wolfcam seems to lack or has misplaced the shaders for the machine gun muzzle flash and model blood splater when being hit. Anybody know what they are called?




Attachments:
shot0000.jpg
shot0000.jpg [ 57.49 KB | Viewed 84 times ]
Top
                 

surfaceparm nomarks
surfaceparm nomarks
Joined: 10 Aug 2009
Posts: 1005
PostPosted: 02-26-2017 10:11 AM           Profile Send private message  E-mail  Edit post Reply with quote


Have you added your new shaderfile to the shaderlist?
Also you will be looking for q3map_lightsubdivide sooner or later.



_________________
Portfolio
Twitter


Top
                 

The hell good boy
The hell good boy
Joined: 22 Jun 2011
Posts: 1598
PostPosted: 02-26-2017 10:14 AM           Profile Send private message  E-mail  Edit post Reply with quote


cityy wrote:
Have you added your new shaderfile to the shaderlist?
Also you will be looking for q3map_lightsubdivide sooner or later.

Lol you've been quicker :D

Another thought: Always make sure that every path in your shaders in entire shader file is actually correct. One incorrect path may result in entire shader file corruption (which may also trigger next, otherwise good shaders appear missing, breaking entire game). Check also syntax correctness of your shaders. This one looks fine from screenshot.

Is that Quake Live or Quake III Arena? Why are you using Wolfcam? You need to use Wolfcam for neighter of these games anymore. Quake Live supports for custom maps additions now and Quake III Arena is already custom additions friendly. Looks like you're missing crosshair from screenshot...



_________________
[ Quake III Arena by CZghost | Facebook | Twitter | YouTube | Google+ ]
While you feel the worst ever, turn around facing to Sun and all shadows will pass behind you.” - John Lennon


Top
                 

Recruit
Recruit
Joined: 26 Feb 2017
Posts: 4
PostPosted: 02-26-2017 11:25 AM           Profile Send private message  E-mail  Edit post Reply with quote


I'm using Wolfcam because it was suggested somewhere. I've figured out could just as well use ioquake which is Q3 Area, I just have to set radiant to the other engine path.

All my paths are correct as far as I can tell. Basically I using a text book example. The only differrence between mine and the one in the pak0 is file location. I believe I have the paths correct because the engine can find the texture. I have other shaders I've written in my custom shader file which is listed in shaders.txt and they work.

So, I'm at a loss to explain why the surfacelight keyword is apparently being ignored in my custom shaders.

Here's the one that fails to work:

textures/custom/custom_white_light
{
qer_editorimage textures/custom/ceil1_38.tga
q3map_surfacelight 5000
{
map $lightmap
rgbGen identity
}
{
map textures/custom/ceil1_38.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/custom/ceil1_38.blend.tga
blendfunc GL_ONE GL_ONE
}
}

This is the one in the screenshot. It's a simple copy except for file location. By the way I want the marks so I took that line out.




Top
                 

The hell good boy
The hell good boy
Joined: 22 Jun 2011
Posts: 1598
PostPosted: 02-26-2017 11:53 AM           Profile Send private message  E-mail  Edit post Reply with quote


And did you actually include that shader file in your shaderlist? Light emitting is generated by q3map2 compiler. If q3map2 doesn't see your shader file in shaderlist, it doesn't load it to consider it while compiling. That includes also for lighting stage, which is highly important in this case. So q3map2 just sees it like an ordinary texture without any effects, so it doesn't enlight the area...



_________________
[ Quake III Arena by CZghost | Facebook | Twitter | YouTube | Google+ ]
While you feel the worst ever, turn around facing to Sun and all shadows will pass behind you.” - John Lennon


Top
                 

Recruit
Recruit
Joined: 26 Feb 2017
Posts: 4
PostPosted: 02-26-2017 12:04 PM           Profile Send private message  E-mail  Edit post Reply with quote


That sounds like what's happening. Although my custom.shader file is included in shaderlist.txt and other shaders in that file work. I said shader.txt before, but that's what I meant shaderlist.txt.

Is there another shaderlist for q3map2?

***

I just tried compiling and running the map with NetRadiant instead of GTKRadiant and it works. The problem must be either the command GtkRadiant is sending to q3map2 or in the version of q3map2 the my install of GtkRadiant provided. Man, did I ever stress myself out for days over that.

NetRadiant has a paticularly nasty bug in it on my system in that if I minimize the window it locks up my whole editor--keyboard and screen.
I have to restart explorer.exe from the taskmanager to get going again. I wonder what that's about.

Anyway at least the lights are on... :cool:




Attachments:
shot0000.jpg
shot0000.jpg [ 106.11 KB | Viewed 77 times ]
Top
                 

The hell good boy
The hell good boy
Joined: 22 Jun 2011
Posts: 1598
PostPosted: 02-26-2017 01:27 PM           Profile Send private message  E-mail  Edit post Reply with quote


It should work with GtkRadiant's q3map2. NetRadiant uses somewhat modified version of q3map2, though. If your GtkRadiant q3map2 (original) version doesn't accept the shader file, then something must be wrong in it. There are two shaderlists in the scripts folder: default_shaderlist.txt and shaderlist.txt - but the default_shaderlist.txt is used only once when the ordinary shaderlist.txt file is missing at the time of first usage of GtkRadiant, that ordinary file is then created from the default one. q3map2 uses only that one ordinary shaderlist. Didn't you make a typo in the shaderlist.txt (or didn't saved the shader file with typo)? You must write exactly the same shader filename in the shaderlist as you saved it. So namely your shader file is named syber3dm1.shader, so you have to write syber3dm1 in your shaderlist. That's very important...



_________________
[ Quake III Arena by CZghost | Facebook | Twitter | YouTube | Google+ ]
While you feel the worst ever, turn around facing to Sun and all shadows will pass behind you.” - John Lennon


Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12186
PostPosted: 02-26-2017 03:14 PM           Profile Send private message  E-mail  Edit post Reply with quote


Try a test case with something like rgbGen const ( 1 0 0 ) on a single stage. Does the image show up red?

If not, then Q3 and Q3Map2 do not see your shader file and the engine is defaulting to the raw texture only. If yes, then Q3 is correctly using your shader but Q3Map2 does not.

Also check your compiler logs for errors.

Lastly, if you have a fairly bright light with the intention of having a fairly high backsplash, you probably don't need a lightmap for that shader since it'll be fullbright anyway.



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 

Recruit
Recruit
Joined: 26 Feb 2017
Posts: 4
PostPosted: 02-26-2017 09:29 PM           Profile Send private message  E-mail  Edit post Reply with quote


I'm fairly sure it's the latter case. Since I wrote other shaders that use rgbGen wave to do things, it was just the q3map2 surfacelight key word that seemed to be getting ignored. NetRadiant worked on the same files in the same engine folder.

I tried coping the version of q3map2 from the NetRadiant folder to the GtkRadiant folder although that failed to help. So it might be one of the other components, q3data or something else. I'm still destressing about it. When I unwind enough I might try to track down the exact component that is the problem.

I had originally wanted to create a white ceiling across the entire room as the light source in the room. After i got it working I found that that really failed to work out as I had imagined anyway. So I went back to using light entities under a white texture on the ceiling. That accomplished the effect I wanted, just less elegantly.




Top
                 

The hell good boy
The hell good boy
Joined: 22 Jun 2011
Posts: 1598
PostPosted: 02-27-2017 07:44 AM           Profile Send private message  E-mail  Edit post Reply with quote


At least you finally managed to get your light working :D

I really don't know what's wrong with your GtkRadiant installation. Are you using the latest build (1.6.4)? NetRadiant is made up from GtkRadiant 1.5 and I'm afraid it's not further supported and developed. GtkRadiant is. If you don't have latest GtkRadiant version, try it up instead of NetRadiant...



_________________
[ Quake III Arena by CZghost | Facebook | Twitter | YouTube | Google+ ]
While you feel the worst ever, turn around facing to Sun and all shadows will pass behind you.” - John Lennon


Top
                 

I'm the dude!
I'm the dude!
Joined: 04 Feb 2002
Posts: 12186
PostPosted: 03-03-2017 01:19 PM           Profile Send private message  E-mail  Edit post Reply with quote


When compiling, are you using the 32-bit or 64-bit version of Q3Map2? Could you try using the other one and report back whether or not it works?



_________________
GtkRadiant | Q3Map2 | Shader Manual


Top
                 
Quake3World.com | Forum Index | Level Editing & Modeling


Post new topic Reply to topic


cron
Quake3World.com
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group