File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Sources/GateEngine/System/Rendering Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ import Shaders
9393 transforms: transforms,
9494 material: material,
9595 vsh: ( material. channels. first? . texture != nil ) ? . standard : material. channels. first? . color == . vertexColors ? . vertexColors : . standard,
96- fsh: ( material. channels. first? . texture != nil ) ? . textureSample : material. channels. first? . color == . vertexColors ? . vertexColor : . materialColor,
96+ fsh: ( material. channels. first? . texture != nil ) ? . textureSampleTintColor : material. channels. first? . color == . vertexColors ? . vertexColor : . materialColor,
9797 flags: flags. drawCommandFlags ( withPrimitive: . triangle, blendMode: blendMode)
9898 )
9999 self . insert ( command)
Original file line number Diff line number Diff line change @@ -136,6 +136,15 @@ extension FragmentShader {
136136 } ( )
137137 /// Uses material.channel(0).texture to shade objects
138138 public static let textureSampleTintColor : FragmentShader = {
139+ let fsh = FragmentShader ( )
140+ let sample = fsh. channel ( 0 ) . texture. sample (
141+ at: fsh. input [ " texCoord0 " ]
142+ )
143+ fsh. output. color = Vec4 ( sample. rgb * fsh. channel ( 0 ) . color. rgb, sample. a)
144+ return fsh
145+ } ( )
146+ /// Uses material.channel(0).texture to shade objects
147+ public static let textureSampleTemplateTintColor : FragmentShader = {
139148 let fsh = FragmentShader ( )
140149 let sample = fsh. channel ( 0 ) . texture. sample (
141150 at: fsh. input [ " texCoord0 " ]
You can’t perform that action at this time.
0 commit comments