assuming I want my game to have a Cel-shaded look. There are plenty of tutorials how to implement Cel-shading in hlsl f.e. But what is the point? If I am creating my assets with Blender or 3d-max I have a lot of possibilities to add materials and shaders in the modeling software.
So why write shaders?
Answer
First, ok-to-good question. Definitely not a bad question. To answer it, you just have to know what a shader is and why you need one.
A shader is exactly what it sounds like - it "shades" vertices and pixels different colors. "Shading" isn't just "making it darker" (as the technical artistic term means I believe), it's application of textures, lighting, and everything else that gives a vertex it's final color.
"Shading" often makes the most sense if you think about some light source. You can't really have toon shading without a light source. You have to have light (and an angle to the light) to know how to shade an object in that light. And that's the job of the shader.
So, now you have a vertex/pixel shader that will do toon shading in Blender. Great. Why do you need to know HLSL if you can make a toon shader in Blender?
If Blender exports HLSL code that you can plug into XNA, then you don't need to write the HLSL yourself. You are correct. You wouldn't need to hear about, see, or touch HLSL code if Blender exports it for you. But I'm not sure if Blender can do that.
So if Blender does not HLSL shading code, then you need to write a toon shader in HLSL because all you'd get is the model and vertices and their respective solid colors, but you wouldn't get "how it should look at every single angle and under every possible light source" right - that needs to be computed at runtime (by a shader).
No comments:
Post a Comment