LightConeAngles

Blitz3D Forums/Blitz3D Programming/LightConeAngles

Stevie G(Posted 2007) [#1]
Hello,

I'll looking to create a beam of light shinning direcly down on a custom landscape. I'm using a point light but this LightConeAngles command isn't very clear .. what exactly are you defining by the inner and outer angles.

This is the kinda thing I'm talking about ... the beam is a mesh but I also want it to light the surrounding area probably by about double the radius of the beam mesh. It's for a mini-game ... first to the light gets a point etc..

Anyone had any success with this command and can shed light on how it works?



I'm looking to get an effect like this .... Fredborgs Tiny Racers ...




Matty(Posted 2007) [#2]
Use a spot light to use the lightcone angles.


Stevie G(Posted 2007) [#3]
Yes, but what do the angles represent. It makes no sense to me?


Dreamora(Posted 2007) [#4]
inner angle: angle from center at which the light starts to shine
outer angle: angle from center at which the light stops to shine

inner is normall 0 unless you want it not to shine around the direct straight line out of the light source.

and what you see there in fredborgs sample is 1 light (most likely point) and 3d objects that represent thta beam


big10p(Posted 2007) [#5]
Just had a mess with LightConeAngles and they beat me too, tbh. No matter what I set them to, it doesn't seem to make a blind bit of difference.

Anyway, I doubt a spotlight is what you want for this effect, Stevie - they're ugly.

Fredborg's effect looks like a set of additive blended, concentric cylinders whose alpha decreases towards the outer cylinder. I guess the 'cheapest' way to do this would be to combine the cylinders into a single mesh and use vertex alpha, instead of having a separate mesh/surface for each cylinder.

[edit]It also looks like fredborg is graduating the vertex alpha from 0 (at the top of the cylinder) to max_alpha_for_this_cyclinder (at the bottom). Except for the central cylinder, which appears to have full alpha strength throughout.


Stevie G(Posted 2007) [#6]
I'll have a mess around but so far spotlights do look pretty ugly on a flatshaded landscape, some tris are completely lit and others are not even if the normals are very similar - bizarre.

I use the vertexalpha trick already as you can see but adding some more cylinders to the mesh seems to be the way to go. Hopefully that'll give me the effect I'm looking for. I may not even need a light.

[edit] Actually I don't think he's using alpha at all, just vertex colours with additive blending ... top of the cylinder is black and bottom are varying degrees of light green. I'll post results.

Cheers folks

Stevie


big10p(Posted 2007) [#7]
Ah yes - vertex colours - your're probably right.


Stevie G(Posted 2007) [#8]
Looks great now I think .... no need for any additional lights either :)




Ross C(Posted 2007) [#9]
You try using a different blend mode for the cylinders? Maybe give it a more uniform spot light look?

EDIT: it looks good yeah :o) Maybe it is using additive blending. Been a while since i seen it :D


big10p(Posted 2007) [#10]
Looking good, Stevie.


Stevie G(Posted 2007) [#11]
I'm happy with it now - it fits the rest of the graphical style. I did just use additive blending with vertexcolors and merged everything into one single mesh.

Cheers
Stevie