I see what you are doing but would you have to render the object several times?
I implemented an infinte lights shader by passing large arrays and using loops in the shader code to process infinite amounts of lights in a single rendering of the object.
well they arent infinite lights but the code is extensible and uses "fake dynamic memory mangement" to render a user defined amount of lights
Since currently shaders dont have dynamic memory management the user specifies the maxiumum amount of lights they think their card can handle and the shader code is modified in runtime before its compiled
therefore multiple "passes" or calculations can be achieved with no Hardwired code moreover the object is rendered once only
real use of multiple passes would require using the old image then using it again in ways that cannot be bypassed by loops, such as a grass/fur shader since the effect defies the size of the mesh (most algorithms render a sphere with dots each pass that gets bigger each pass then all the sphere are combined by a postprocessor)
good idea for multiple lights but i belive your method require the whole object to be rendered again ie to get the vertices down from the cpu->agp->gpu
rather than computing lights info in a array passed to a shader with only 1
cpu->agp->gpu
Btw i didnt see your shader code but i guess thats what you are doing if i have misunderstood your method then please accept my apologies
count = Begin() return the number of passes on begin rendering af a node
for every pass I re-render the node with BeginPass(), EndPass()
End()
This method is dynamic and the loops are in the C++ code not in the Shader code. And every pass is blended with additive blending.
(I chose this method because loops must be fully unwrap in Shader Model 2.0)
Nice method of yours is that it doesnt require high shader models
I dont see your method as very useful for lighting but the glblend method eliminates the need for a postprocessor when rendering grass.
Thats pretty nice way of rendering grass!
I hope you devlop this method into something cool that takes advantages of its unique approach.
omaremad wrote:I implemented an infinte lights shader by passing large arrays and using loops in the shader code to process infinite amounts of lights in a single rendering of the object.
Hi,
could you please give me an example how to do multiple lights using shaders in one pass?