Sign in to follow this  

shader and full illumination from eye pos

This topic is 1177 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello. How i can create a shader that illuminate with one light all the mesh that i would display?
in glsl or gl es 2.0.
I have an orbit camera and i would that the mesh or the meshes in the target position are illuminated, there is a trick? or i must use more than one lamp?
I can set the light always in the eye position ?
thanks.

Share this post


Link to post
Share on other sites

This is not possible in the traditional forward-rendering model.

That is, those meshes will get drawn with their shaders. If it includes lighting good, otherwise, you're basically done with it.

 

In the past multipass rendering would have been used but nowadays, with DOT3 and such simple framebuffer color access does not cut it anymore (and no, I don't consider "proxy geometry" a viable solution).

 

If you need to decouple lighting computation from geometry then you need to look into deferred shading.

Share this post


Link to post
Share on other sites

This is not possible in the traditional forward-rendering model.

That is, those meshes will get drawn with their shaders. If it includes lighting good, otherwise, you're basically done with it.

 

In the past multipass rendering would have been used but nowadays, with DOT3 and such simple framebuffer color access does not cut it anymore (and no, I don't consider "proxy geometry" a viable solution).

 

If you need to decouple lighting computation from geometry then you need to look into deferred shading.

thanks.
I would use this in a mobile platform an iphone or android and i see that i don't have enought fillrate for deferred shading, what is your advice for create a decent illumination for 100 150 meshes(square mesh or box) on a mobile device with opengl es 2.0?
is impossible?
Thanks.

Share this post


Link to post
Share on other sites

I have no experience with mobile. If you manage to keep the batch count low enough I think doing it in a shader might be viable. You'll have to modify each shader to switch on an uniform variable.

Share this post


Link to post
Share on other sites

This topic is 1177 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this