Message 1 of 3
Change gNormal on Shading pass

Not applicable
01-15-2010
03:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I need to make a proxy material that will shade backfaces faces with the frontfaces shade.
I didn't find a way to do it with maxscript because I don't have access to shading.
So I've go with SDK.
May approach is to change the fragment normal so it will be inverted if it is a backface and then pass to correct Material shading, but I don't have access to gNormal.
It is possible to change somehow fragment normal before passing it to next Material Shade?
I need something in this style.
I need to make a proxy material that will shade backfaces faces with the frontfaces shade.
I didn't find a way to do it with maxscript because I don't have access to shading.
So I've go with SDK.
May approach is to change the fragment normal so it will be inverted if it is a backface and then pass to correct Material shading, but I don't have access to gNormal.
It is possible to change somehow fragment normal before passing it to next Material Shade?
I need something in this style.
void maxProject2::Shade(ShadeContext& sc)
{
sc.GNormal = new Point3(-sc.GNormal().x,-sc.GNormal().y,-sc.GNormal().z)
Mtl *sm1 = mapOn?submtl:NULL;
if (gbufID) sc.SetGBufferID(gbufID)
...
}