1
Feature requests / Vertex Shader
« on: August 30, 2010, 11:08:38 pm »
Actually the lighting is done in a pixelshader...
The vertexshader is only needed to calculate texcoords.
I render 1 pass colors only into a target,
I render 1 pass normals only (world coords) into a target.
Then I use small sprites for every light, using 3 textures:
the 2 rendertargets and a mask.
And this is where the Vertexshader is needed: this sprite has a second set of texcoords containing its world coordinates. This coordinates are used to make a lookup in the color&normal buffer. Then we I can calculate the light influence. Of this light in the world as texture of my sprite. The sprite is finally blended additively. and dadada.. very little overhead for pixel not being reached by the light. Its called "Deferred Lighting"
(sry its late..)
greetz
The vertexshader is only needed to calculate texcoords.
I render 1 pass colors only into a target,
I render 1 pass normals only (world coords) into a target.
Then I use small sprites for every light, using 3 textures:
the 2 rendertargets and a mask.
And this is where the Vertexshader is needed: this sprite has a second set of texcoords containing its world coordinates. This coordinates are used to make a lookup in the color&normal buffer. Then we I can calculate the light influence. Of this light in the world as texture of my sprite. The sprite is finally blended additively. and dadada.. very little overhead for pixel not being reached by the light. Its called "Deferred Lighting"
(sry its late..)
greetz