Use toon shading, cleanup resources for debug marker example
This commit is contained in:
parent
ea61df3b55
commit
8ee6a9f149
8 changed files with 45 additions and 3407 deletions
|
|
@ -1,5 +1,5 @@
|
|||
glslangvalidator -V phongpass.vert -o phongpass.vert.spv
|
||||
glslangvalidator -V phongpass.frag -o phongpass.frag.spv
|
||||
glslangvalidator -V toon.vert -o toon.vert.spv
|
||||
glslangvalidator -V toon.frag -o toon.frag.spv
|
||||
glslangvalidator -V colorpass.vert -o colorpass.vert.spv
|
||||
glslangvalidator -V colorpass.frag -o colorpass.frag.spv
|
||||
glslangvalidator -V postprocess.vert -o postprocess.vert.spv
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -27,4 +27,13 @@ void main()
|
|||
vec3 diffuse = max(dot(N, L), 0.0) * color;
|
||||
vec3 specular = pow(max(dot(R, V), 0.0), 16.0) * vec3(0.75);
|
||||
outFragColor = vec4(ambient + diffuse * 1.75 + specular, 1.0);
|
||||
|
||||
float intensity = dot(N,L);
|
||||
float shade = 1.0;
|
||||
shade = intensity < 0.5 ? 0.75 : shade;
|
||||
shade = intensity < 0.35 ? 0.6 : shade;
|
||||
shade = intensity < 0.25 ? 0.5 : shade;
|
||||
shade = intensity < 0.1 ? 0.25 : shade;
|
||||
|
||||
outFragColor.rgb = inColor * 3.0 * shade;
|
||||
}
|
||||
BIN
data/shaders/debugmarker/toon.frag.spv
Normal file
BIN
data/shaders/debugmarker/toon.frag.spv
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue