These shaders utilize a single directional light and feature an Ambient Color as well.
Maya CGFX File:
vertexlitlamberttexture.cgfx |
Unity SHADER File:
vertexlitlamberttexture.shader |
Cross-Origin-Embedder-Policy="require-corp" Cross-Origin-Opener-Policy="same-origin"
I decided to start out the lit shaders with a Vertex Lit Lambert Shader, as it was the simplest lighting I could imagine. Technically Pixel Lit shaders aren't any more difficult, but I figured I should cover it before moving on. Vertex Lighting is lower fidelity than Pixel Lighting but they are fast, which means you might want them for mobile. I don't think Maya even has any Vertex Lit shaders these days, so it might be useful for someone working on mobile assets i guess. These shaders utilize a single directional light and feature an Ambient Color as well. Maya CGFX File:
Unity SHADER File:
2 Comments
Mahmoud AlSati
1/26/2016 12:21:15 pm
Hi,
Reply
Gabe
2/3/2016 09:10:18 am
Yeah looking back that code looks a bit silly - it probably should be _Object2World instead of _World2Object. You absolutely could do lighting in object space if you wanted, you just have to make sure you convert everything that's in world space into the object space - light direction, light position, ect. This ultimately comes down to the number of things that you need to transform into the correct space, and if that is more or less expensive than what you are already working in
Reply
Leave a Reply. |
CG ShadersShaders I've built as i teach myself CG. Feel free to download and use for whatever. If you like them you can buy me a beer or something. Archives
December 2014
Categories |