Page 2 of 2

Posted: Fri Aug 01, 2008 8:52 pm
by christianclavet
Hi, Nadro.

A little question about shaders.

If I have a scene with almost 200+ lights, I know that shaders can't use them all. Is there a automatic mecanism that would take the nearest lights to the capacity of the shader (2/4/8 lights) or this need to be coded? (My principal concerns are about Normal/Specular mapping)

If this need to be coded, will it need to be in C++ or done inside the shader itself (.cg, .hlsl, or .glsl)

I really don't understant this about the shader process.

Posted: Sat Aug 02, 2008 1:43 am
by BlindSide
With deferred shading you can have 200 lights.

Posted: Sat Aug 02, 2008 5:52 am
by Dorth
Lighting limitation was a big problem with the last gen cards and techniques. With the current techniques and shader functions, well thought-out lighted environments basically have no more lights limitation, which is great. I think some of those systems already made or are making their ways to Irrlicht and if the demand is good, more will soon I guess. I've got to admit, a deferred lighting that would give good lighting with lots of lights AND good shadows would really hit the spot right about now ;) :P

Posted: Sat Aug 02, 2008 5:49 pm
by christianclavet
HI, Thanks about the info about "deferred shading", but not sure this will be possible. First, I don't know anything about this and we don't any shading programmer in our team.

We'll need to use something that could be created from IRRcg. Fullmetalcoder is doing great on the engine but warned me that he don't think he'll do shaders for the engine.

Using a CG script for normal/specular shading, how is that accounting for the nearest lights. Or we have to input the light manually in the shaders?

For shadowing, would you recommend a shader based shadowing (again how it will account for that? (moving object going thru the level)).

Stencil shadows are still buggy or there is something that can prevent the false shadows? (Sorry, that question is out of the thread subject)

Posted: Sat Aug 02, 2008 6:51 pm
by Dorth
Irrcg ARE shaders >.<

Posted: Sat Aug 02, 2008 11:02 pm
by Nadro
Hi christianclavet,

I think than for modern games deferred shading is the best solution. Between creating shaders for Deferred Shading and Forward Rendering is only one difference. For DS You have to write G-Buffer. In first standard pass You write to RT textures (high precision or You have to use packing) infos as: position, normals, color etc. In next pass You get position, normals etc. values from created RT textures (in Forward rendering You get this value from re-rendering vertex in each pass). You can use G-Buffer write method from my Deferred Shading demo (with source code) on Irrlicht forum, this demo use IrrCg and only Cg shaders.

If You prefer Forward Rendering method You have to create function for finding nearest light in Your c++ mainly code and send this lights values to shader (In Irrlicht source You can find similar function for finding 8 nearest lights).

Posted: Sun Aug 03, 2008 12:37 am
by grayman
Nadro Pro!!!, im really interesed about irrCg binding but i really dont know what it really do, where could i see a tutorial?, and if i want to load the crate from the example in a normal irrlicht source and with all that maps, how could i do that?

I download your editor and it opens well on my ubuntu x64 using Wine 1.1.2 and seems work fine.

great work thanks!

Posted: Sun Aug 03, 2008 10:57 am
by Nadro
grayman wrote:Nadro Pro!!!, im really interesed about irrCg binding but i really dont know what it really do, where could i see a tutorial?, and if i want to load the crate from the example in a normal irrlicht source and with all that maps, how could i do that?

I download your editor and it opens well on my ubuntu x64 using Wine 1.1.2 and seems work fine.

great work thanks!
Hi grayman,
You can see how to work IrrCg in examples from IrrCg. In next release I plan add normal tutorial for it. You can use Cg shader via IrrCg very similar to use HLSL, GLSL via native Irrlicht core.