Lighting behavior differences between orthographic and perspective cameras #1481
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
At this point I am perplexed by what is going on. I have just tested the orthographic vsgExample and got the same odd banding result if I move the eye point in/out: vsgorth models/teapot.vsgt The lighting positions are all transformed into a eye space by vsg::ViewDependentState and these are passed to the GPU as uniform. The shaders that will be used for the models/teapot.vsgt https://github.com/vsg-dev/vsgExamples/blob/master/data/shaders/standard.vert The shaders are written and tested for perspective views so there must be assumptions when computing the light, eye position or angle between the light, surface and eye that is causing issues. It might be that we need to use slightly different maths to handle the oddities of the orthographic "eye" that is essentially at infinity. I have other tasks to get on with right now so can't look further into this issue. |
Beta Was this translation helpful? Give feedback.
-
Glad to found a fix. Once I've wrapped up my present work I'll apply something similar to the built in shaders. FYI, uou don't need to need to load a model and then modify shaders, you can create a custom ShaderSet and pass this into the loader via vsg::Options. The vsgcustomshaderset example illustrates how this is done. |
Beta Was this translation helpful? Give feedback.
Glad to found a fix. Once I've wrapped up my present work I'll apply something similar to the built in shaders.
FYI, uou don't need to need to load a model and then modify shaders, you can create a custom ShaderSet and pass this into the loader via vsg::Options. The vsgcustomshaderset example illustrates how this is done.