Sketch ini
This commit is contained in:
parent
8866290d29
commit
f8c38a8a37
16 changed files with 2510 additions and 0 deletions
28
Sketch3D/rsc/shaders/stroke.frag
Normal file
28
Sketch3D/rsc/shaders/stroke.frag
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
#version 330 core
|
||||
|
||||
uniform vec4 Color;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
uniform float Target;
|
||||
uniform vec4 BGCol;
|
||||
|
||||
#define A 0.1f
|
||||
|
||||
void main() {
|
||||
float x = gl_FragCoord.z;
|
||||
|
||||
float val = A;
|
||||
|
||||
float f = Target * 2;
|
||||
|
||||
if (x < f) {
|
||||
val = ((A - 1) / f) * x + 1;
|
||||
}
|
||||
|
||||
val = clamp(val, A, 1);
|
||||
|
||||
|
||||
color = vec4((Color.xyz - BGCol.xyz) * val + BGCol.xyz, 1.f);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue