-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb151ae
commit 5de3fa0
Showing
6 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
precision mediump float; | ||
|
||
uniform sampler2D uTexDiffuse; | ||
|
||
in vec2 varTexCoord0; | ||
in vec4 varColor; | ||
out vec4 FragColor; | ||
|
||
void main(void) | ||
{ | ||
vec4 color = texture(uTexDiffuse, varTexCoord0.xy) * varColor; | ||
float lum = max(dot(color.rgb, vec3(0.299, 0.587, 0.114)), 0.0001); | ||
FragColor = vec4(lum, 0.0, 0.0, 0.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Texture2D uTexDiffuse : register(t0); | ||
SamplerState uTexDiffuseSampler : register(s0); | ||
|
||
struct PS_INPUT | ||
{ | ||
float4 pos : SV_POSITION; | ||
float4 color : COLOR0; | ||
float2 tex0 : TEXCOORD0; | ||
}; | ||
|
||
float4 main(PS_INPUT input) : SV_TARGET | ||
{ | ||
float4 color = input.color * uTexDiffuse.Sample(uTexDiffuseSampler, input.tex0); | ||
float lum = max(dot(color.rgb, float3(0.299, 0.587, 0.114)), 0.0001); | ||
return float4(lum, 0.0, 0.0, 0.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<shaderConfig name="Luminance" baseShader="SOLID"> | ||
<uniforms> | ||
<vs> | ||
<uniform name="uMvpMatrix" type="WORLD_VIEW_PROJECTION" value="0" float="16" matrix="true"/> | ||
</vs> | ||
<fs> | ||
<uniform name="uTexDiffuse" type="DEFAULT_VALUE" value="0" float="1" directX="false"/> | ||
</fs> | ||
</uniforms> | ||
<customUI> | ||
<ui control="UIGroup" name="Texture"> | ||
<ui control="UITexture" name="uTexDiffuse" autoReplace="_diff.tga"/> | ||
</ui> | ||
</customUI> | ||
<shader type="GLSL" vs="GLSL/TextureColorVS.glsl" fs="GLSL/LuminanceFS.glsl"/> | ||
<shader type="HLSL" vs="HLSL/TextureColorVS.hlsl" fs="HLSL/LuminanceFS.hlsl"/> | ||
</shaderConfig> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters