File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Sources/GateEngine/System/Rendering Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,17 @@ extension FragmentShader {
124124 fsh. output. color = color. discard ( if: color. a <= 0 )
125125 return fsh
126126 } ( )
127+ /// Uses material.channel(0).texture to shade objects
128+ public static let textureSample_TintVertexColor_DiscardZeroAlpha : FragmentShader = {
129+ let fsh = FragmentShader ( )
130+ let sample = fsh. channel ( 0 ) . texture. sample (
131+ at: fsh. input [ " texCoord0 " ]
132+ )
133+ let vertexColor : Vec4 = fsh. input [ " color " ]
134+ let color = Vec4 ( sample. rgb * vertexColor. rgb, sample. a * vertexColor. a)
135+ fsh. output. color = color. discard ( if: color. a <= 0 )
136+ return fsh
137+ } ( )
127138 /// Uses material.channel(0).color to shade objects
128139 public static let materialColor : FragmentShader = {
129140 let fsh = FragmentShader ( )
You can’t perform that action at this time.
0 commit comments