Need help: Fake Lights for a car?!?

Blitz3D Forums/Blitz3D Programming/Need help: Fake Lights for a car?!?

N_Gnom(Posted 2014) [#1]
Have anyone here an idea to fake the headlights from a car.
I try a spotlight but on a lowpoly terrain its jerky.


Kryzon(Posted 2014) [#2]
If you want to continue using a spot-light, you can play with the TerrainDetail command and make your terrain more detailed: The greater the number of triangles (more importantly, of vertices), the less the vertex-lighting-based artifacts. This is the brute-force approach.
http://blitzbasic.com/b3ddocs/command.php?name=TerrainDetail&ref=3d_cat

Another option, and I'm not sure if it works with the internal terrains, would be to use freborg's texture projection code to project a triangular car light texture from a slightly tilted\angled source. This is a smarter approach and should yield a better result.
http://blitzbasic.com/codearcs/codearcs.php?code=1000


RemiD(Posted 2014) [#3]
One approach is to use a subdivided terrain : instead of having one vertex each one unit, you could have 2 vertices or more each one unit.
See this render :


This is done with one omnilight and a terrain with a high enough lod and one vertex each 0.5 unit.



Also you may be interested in this approach (a mini terrain or a mini subdivided quad mesh, with its vertices aligned above the terrain/ground) :
http://www.blitzbasic.com/codearcs/codearcs.php?code=1462


Mikorians(Posted 2014) [#4]
Best looking? I would suggest a graduated translucent (using vertex alpha) boxoid with its bottom quad aligned to the terrainheight, set to fully opaque, and flipped upward. Can't say immediately how to align it, but using similar techniques to some sort of shadow mapper, and/or a guesstimate on height is is how I'd do it. If the boxes bottom won't behave, either make the whole box more opaque or add a second shallow solid-white box to the bottom.
(Sorry I can't be more specific, it's only an idea)