Lighting for a cel-shaded mod map

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Element4q2
Posts: 6
Joined: Tue Feb 22, 2005 2:50 pm

Lighting for a cel-shaded mod map

Post by Element4q2 »

Well i started mapping due to our mod lacking a dedicated mapper and i seem to be doing okay so far. One problem though - I need to light this map in a way that will look good with the cel-shading style.

My objective was to turn that roof into a light using a shader (e.g. q3map_sun, but that looked crap as any place the sun didnt touch was pitch black)

Now the main issue is i need a better way to do this...I was thinking perhaps making an invisible and nonsolid brush emit light, but i'm unsure of how to go about that. Or even sticking with the roof shader idea, but likewise i havent found a way to get it to emit non colored light.

Light entities just leave ugly light blobs that don't fit in well with the style i'm going for

Ideally it would be great if i could have the light not actually highlighting the textures, but instead just darking through the projected shadows (if this is possible)

Anybody got any "bright" (geddit? :icon25: ) ideas? They would be greatly appreciated.

Image
Meridanox
Posts: 41
Joined: Thu Feb 17, 2005 7:12 pm

Re: Lighting for a cel-shaded mod map

Post by Meridanox »

Element4q2 wrote:My objective was to turn that roof into a light using a shader (e.g. q3map_sun, but that looked crap as any place the sun didnt touch was pitch black)
q3map_sun for the most part is deprecated in favour of q3map_sunExt. Not sure what kind of results it would bring for a cel shaded map, but you can try it and see how it looks.
http://shaderlab.com/q3map2/shader_manu ... tml#sunExt
Element4q2 wrote:I was thinking perhaps making an invisible and nonsolid brush emit light, but i'm unsure of how to go about that.
Try something like this:

Code: Select all

// Non-drawing light emitting surface light for use as lightboxes
textures/obsidian_common/lightbox
{
	q3map_lightRGB 1 1 1
	q3map_surfacelight 5000

	surfaceparm nolightmap
	surfaceparm nonsolid
	surfaceparm trans

	qer_editorimage textures/obsidian_common/FFFFFF.tga
	{
		map $whiteimage
		alphaFunc GE128
		alphaGen const 0
	}
}
Element4q2 wrote:Or even sticking with the roof shader idea, but likewise i havent found a way to get it to emit non colored light.
The colour of the light emitted is the average colour of the pixels of the textures when using q3map_surfaceLight. With Q3Map2 sky shaders you shouldn't need to use q3map_surfaceLight anymore. See this:
http://shaderlab.com/q3map2/shader_manual/apI.html
The colour of light is set by the R G B parameters of the q3map_sunExt. If you ever need to force the colour of any other light emitting shader, you can use q3map_lightRGB.
Element4q2 wrote:Ideally it would be great if i could have the light not actually highlighting the textures, but instead just darking through the projected shadows (if this is possible)
Have you tried playing around with the -gamma and -compensate compiler switches?
[url=http://shaderlab.com/]Q3Map2[/url] | [url=http://shaderlab.com/q3map2/shader_manual/]Shader Manual[/url] | [url=http://en.wikibooks.org/wiki/Q3Map2]Wiki Manual[/url]
Element4q2
Posts: 6
Joined: Tue Feb 22, 2005 2:50 pm

Post by Element4q2 »

Thanks, i'll try out your suggestions and hope for the best :D
voodoochopstiks
Posts: 248
Joined: Tue Jun 08, 2004 7:00 am

Post by voodoochopstiks »

try -bounce 8 or the like maybe? Would probably eliminate the total blackness.
[i][color=#408080]Give someone a program, frustrate them for a day. Teach someone to program, frustrate them for a lifetime.[/color][/i]
Element4q2
Posts: 6
Joined: Tue Feb 22, 2005 2:50 pm

Post by Element4q2 »

Ok, i've got something to work from now. This seems to look like what i'm going for, just need to find a way to lighten up those shadows. I'll likely have to adjust my textures after this.

Anyway anybody care to explain how i go about using -gamma / -compensate / -bounce 8

Image
dzjepp
Posts: 12839
Joined: Wed Mar 28, 2001 8:00 am

Post by dzjepp »

That looks nice! :D

Who is that person stuck in the wall there? :)
voodoochopstiks
Posts: 248
Joined: Tue Jun 08, 2004 7:00 am

Post by voodoochopstiks »

I failed to see this before, but I notice now its the arena from naruto :D However I remember it as more round, but oh well :D
[i][color=#408080]Give someone a program, frustrate them for a day. Teach someone to program, frustrate them for a lifetime.[/color][/i]
Element4q2
Posts: 6
Joined: Tue Feb 22, 2005 2:50 pm

Post by Element4q2 »

I failed to see this before, but I notice now its the arena from naruto However I remember it as more round, but oh well
Heh, i guess that means the lighting makes it look like something now. Oh and the arena is only rounded at one end (the end behind the camera in this case :p )

Still trying to figure out this -gamma / -compensate / -bounce 8 thing.
Meridanox
Posts: 41
Joined: Thu Feb 17, 2005 7:12 pm

Post by Meridanox »

Looking good Element4q2!

-bounce 8:
Adds radiosity - light "rays" will bounce a maximum of 8 times if necessary. It reduces the occurance of perfectly black shadows and takes surface colour into consideration for coloured light reflection. You can set the value of bounce to any number you like but keep in mind that larger values will result in greatly increased compile times. 8 is usually as high as you will ever need. Use a lower value (like 2) for test compiles.

Check out this screenshot that ydnar has on the front page of shaderlab.com, you can see the reflected colour cast by the red wall onto that block in the back:
Image

-gamma tweaks the overbrightbits in Q3 while -compensate corrects it. Not sure how to explain this in words (you can see the difference in some of the technical tests that ydnar posted), but it adjusts the lightmaps brightness/contrast. Generally, I start with values of -gamma 2 -compensate 4, and then play around with these to see what looks best.

Download the latest version of Q3Map2 if you haven't already, and then read the readme.txt in the zip. Lots of good info in there, though brief and technical.

Q3map2 2.5.16: http://shaderlab.com
Manual (outdated but still useful): http://shaderlab.com/q3map2/manual/
Shader Manual: (see my signature)
Q3Map2 Wiki: http://en.wikibooks.org/wiki/Q3Map2
[url=http://shaderlab.com/]Q3Map2[/url] | [url=http://shaderlab.com/q3map2/shader_manual/]Shader Manual[/url] | [url=http://en.wikibooks.org/wiki/Q3Map2]Wiki Manual[/url]
Element4q2
Posts: 6
Joined: Tue Feb 22, 2005 2:50 pm

Post by Element4q2 »

Thanks for the tips, the lighting looks great now :)

Oh and any mappers wanting to help us out would be great since we're pretty well established but desperately need at least one dedicated mapper (as thats our main holdback atm and i should be busy with modelling and skinning)

Just pm me or visit http://www.ninja-densetsu.com (shameless plug that is hopefully not against policy :p )
Colin-X
Posts: 1
Joined: Wed Mar 02, 2005 12:06 pm

Post by Colin-X »

Hey, that map looks pretty cool, you captured it right...and yaeh I'm a pretty big fan of naruto myself. And that mod looks intresting too, but I'm sorry I can't help you out though.
Post Reply