tomcio
04-09-2011, 08:07 AM
Hi
Soon I will be dealing with lighting and shadowing problems and I hope for some of more experienced contributors to point me in right direction.
-- Lights
1) Should I calculate lighting together witch texturing and other effects (excluding shadows) in single shader or is it better to do lighting in different pass.?
2) Would it be a good solution to calculate, which lights affect which object and then set those
lights (as uniforms) per object - that method could be more precise but would require setting
light uniforms for every object and also calculating, which lights affect object (this could be done each frame)?
3) Alternatively - is setting many lights as a lighting group, which affects many objects any good?
That could limit uniform setting but would require much more lighting calculations inside shaders that will not contribute to final image.
-- Shadows
4) When creating shadowmap for one light should I select only the objects that the light affects. I suppose so but just have to ask.
5) I just can't get a gripe on how exactly to put shadows on objects. First I should draw objects affected by single shadow casting light to shadowmap but what then, should I apply the shadowmap to all objects in certain range in FOV or select objects that are affected by this specific shadowmap?
Thanks
Soon I will be dealing with lighting and shadowing problems and I hope for some of more experienced contributors to point me in right direction.
-- Lights
1) Should I calculate lighting together witch texturing and other effects (excluding shadows) in single shader or is it better to do lighting in different pass.?
2) Would it be a good solution to calculate, which lights affect which object and then set those
lights (as uniforms) per object - that method could be more precise but would require setting
light uniforms for every object and also calculating, which lights affect object (this could be done each frame)?
3) Alternatively - is setting many lights as a lighting group, which affects many objects any good?
That could limit uniform setting but would require much more lighting calculations inside shaders that will not contribute to final image.
-- Shadows
4) When creating shadowmap for one light should I select only the objects that the light affects. I suppose so but just have to ask.
5) I just can't get a gripe on how exactly to put shadows on objects. First I should draw objects affected by single shadow casting light to shadowmap but what then, should I apply the shadowmap to all objects in certain range in FOV or select objects that are affected by this specific shadowmap?
Thanks