q3map_surfacelight on model


(Gringo Starr) #1

I have surfacelight on an ASE model, and want to prevent part of it from emitting light, while also blocking light. See how the ceiling is being lit by the back of the reflector? I made a lightimage for it, where the top portion of the texture is completely black. Is that how lightimages work? Bright in image = light emitting?

textures/dg_skyscraper/models/pendant2
{
	surfaceparm nomarks
	surfaceparm alphashadow
	q3map_lightimage textures/dg_skyscraper/models/pendant3.tga
	q3map_surfacelight 1500
	q3map_lightrgb 0.80 0.72 0.60
	cull twosided
	light 1
	
// cagelight white
	
	{
		map textures/dg_skyscraper/models/pendant2.tga
		blendFunc GL_ONE GL_ZERO
		rgbGen vertex
	}
	{
		map textures/dg_skyscraper/models/pendant2.tga
		blendfunc GL_ONE GL_ONE
	}
}

Why does it look so much better than a light entity? Is it making each poly of the reflector a seperate point light?


(Hewster) #2

Why does it look so much better than a light entity? Is it making each poly of the reflector a seperate point light?

Yes, and Ydnar will have a go at you if there are too many polys :slight_smile: hehe.

Hewster


(WolfWings) #3

Okay, first off… if you’re using a single shader for the top and bottom of the reflector, you’ll need to change that. Use a seperate shader for the light-emiting and non-light-emiting parts, at the very least. If you want to save on texture-memory, feel free, simply point both shaders to the same texture.

And to explain, _lightimage merely acts as a replacement image for things like AlphaShadow and general radiosity bounces. I don’t know if the texture is sampled point-by-point for radiosity, but I know that it isn’t used for light emission. You need to use seperate shaders (in 2.5.14 at least) for light-emitting versus non-light-emitting parts. :slight_smile:


(Gringo Starr) #4

hmmmm, that poses a problem. First, thank you for the reply. The problem is, I’m not a modeler, and I made this by simply -converting the stock Wolf md3 into an ASE. If I deBSP’d a patchmeta’d BSP, would I be able to change the materials, then reconvert it to an ASE? lol


(WolfWings) #5

Mind posting a non-lit version of the model so I can see how complex it is?

It can probably be reconstructed from patch meshes, and if so I’d be more than happy to do so for you if you’d like?


(Gringo Starr) #6

Awesome! Email me at gringostarr@the-wildwest.com , and I’ll send the model to you. Here are screens of what I came up with using a spotlight. What do you guys think?


(ydnar) #7

Light-emitting models aren’t really the best idea, both from a lighting performance standpoint and because they are affected by -fast in a way that entity/point lights aren’t.

q3map_lightImage affects the following:

  • shader color for light emission and radiosity, except with overridden by q3map_lightRGB
  • alphashadow
  • lightfilter

I’d use an entity light inside the bulb of the model, assuming the lightbulb has a different shader with surfaceparm trans, with the following keys:

“_deviance” “4”
“_samples” “16”

Which would produce 16 jittered light samples within a 4-unit radius around the entity light.

y


(Gringo Starr) #8

Awesome, I never used those keys. How do you think that spotlight looks? I think it more accurately portrays what the lamp would emit. Do those keys work on a spotlight?


(ydnar) #9

Yep.