-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create ProgressBar in Skylicht Editor
- Loading branch information
1 parent
24a2904
commit b53eedb
Showing
14 changed files
with
311 additions
and
59 deletions.
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,18 @@ | ||
precision mediump float; | ||
|
||
uniform sampler2D uTexDiffuse; | ||
uniform sampler2D uTexTiling; | ||
uniform vec4 uColor; | ||
|
||
in vec2 vTexCoord0; | ||
in vec2 vTexCoord1; | ||
in vec4 vColor; | ||
|
||
out vec4 FragColor; | ||
|
||
void main(void) | ||
{ | ||
vec4 diffuseMap = texture(uTexDiffuse, vTexCoord0.xy); | ||
vec4 tileMap = texture(uTexTiling, vTexCoord1.xy); | ||
FragColor = vec4(tileMap.rgb * uColor.rgb * vColor.rgb, diffuseMap.a); | ||
} |
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,22 @@ | ||
in vec4 inPosition; | ||
in vec3 inNormal; | ||
in vec4 inColor; | ||
in vec2 inTexCoord0; | ||
|
||
uniform mat4 uMvpMatrix; | ||
uniform vec4 uUVScale; | ||
uniform vec4 uTime; | ||
uniform vec4 uUVTiling; // TileX;TileY;Speed | ||
|
||
out vec2 vTexCoord0; | ||
out vec2 vTexCoord1; | ||
out vec4 vColor; | ||
|
||
void main(void) | ||
{ | ||
vTexCoord0 = inTexCoord0 * uUVScale.xy + uUVScale.zw; | ||
vTexCoord1 = vec2(inNormal.x, inNormal.y); | ||
vTexCoord1 = vTexCoord1 * uUVTiling.xy + uUVTiling.zw + vec2(uTime.x * uUVTiling.z, 0.0); | ||
vColor = inColor/ 255.0; | ||
gl_Position = uMvpMatrix * inPosition; | ||
} |
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,25 @@ | ||
Texture2D uTexDiffuse : register(t0); | ||
SamplerState uTexDiffuseSampler : register(s0); | ||
|
||
Texture2D uTexTiling : register(t1); | ||
SamplerState uTexTilingSampler : register(s1); | ||
|
||
struct PS_INPUT | ||
{ | ||
float4 pos : SV_POSITION; | ||
float4 color : COLOR0; | ||
float2 tex0 : TEXCOORD0; | ||
float2 tex1 : TEXCOORD1; | ||
}; | ||
|
||
cbuffer cbPerFrame | ||
{ | ||
float4 uColor; | ||
}; | ||
|
||
float4 main(PS_INPUT input) : SV_TARGET | ||
{ | ||
float4 diffuseMap = uTexDiffuse.Sample(uTexDiffuseSampler, input.tex0); | ||
float4 tilingMap = uTexTiling.Sample(uTexTilingSampler, input.tex1); | ||
return float4(tilingMap.rgb * uColor.rgb * input.color.rgb, diffuseMap.a); | ||
} |
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,35 @@ | ||
struct VS_INPUT | ||
{ | ||
float4 pos: POSITION; | ||
float3 norm: NORMAL; | ||
float4 color: COLOR; | ||
float2 tex0: TEXCOORD0; | ||
}; | ||
|
||
struct VS_OUTPUT | ||
{ | ||
float4 pos : SV_POSITION; | ||
float4 color : COLOR0; | ||
float2 tex0 : TEXCOORD0; | ||
float2 tex1 : TEXCOORD1; | ||
}; | ||
|
||
cbuffer cbPerObject | ||
{ | ||
float4x4 uMvpMatrix; | ||
float4 uUVScale; | ||
float4 uTime; | ||
float4 uUVTiling; // TileX;TileY;Speed | ||
}; | ||
|
||
VS_OUTPUT main(VS_INPUT input) | ||
{ | ||
VS_OUTPUT output; | ||
|
||
output.pos = mul(input.pos, uMvpMatrix); | ||
output.tex0 = input.tex0 * uUVScale.xy + uUVScale.zw; | ||
output.tex1 = float2(input.norm.x, input.norm.y); | ||
output.tex1 = output.tex1 * uUVTiling.xy + uUVTiling.zw + float2(uTime.x * uUVTiling.z, 0.0); | ||
output.color = input.color; | ||
return output; | ||
} |
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,30 @@ | ||
<shaderConfig name="ProgressBarUI" baseShader="TRANSPARENT_ALPHA_CHANNEL"> | ||
<uniforms> | ||
<vs> | ||
<uniform name="uMvpMatrix" type="WORLD_VIEW_PROJECTION" value="0" float="16" matrix="true"/> | ||
<uniform name="uUVScale" type="MATERIAL_PARAM" valueIndex="0" value="1.0, 1.0, 0.0, 0.0" float="4"/> | ||
<uniform name="uTime" type="TIME" value="4.0, 0.0, 0.0, 0.0" float="4"/> | ||
<uniform name="uUVTiling" type="MATERIAL_PARAM" valueIndex="2" value="4.0, 1.0, 1.0, -1.0" float="4"/> | ||
</vs> | ||
<fs> | ||
<uniform name="uTexDiffuse" type="DEFAULT_VALUE" value="0" float="1" directX="false"/> | ||
<uniform name="uTexTiling" type="DEFAULT_VALUE" value="1" float="1" directX="false"/> | ||
<uniform name="uColor" type="MATERIAL_PARAM" valueIndex="1" value="1.0, 1.0, 1.0, 1.0" float="4"/> | ||
</fs> | ||
</uniforms> | ||
<resources> | ||
</resources> | ||
<customUI> | ||
<ui control="UIGroup" name="Texture"> | ||
<ui control="UITexture" name="uTexDiffuse" autoReplace="_diff.;_Diffuse.;_D."/> | ||
<ui control="UITexture" name="uTexTiling" autoReplace="_A."/> | ||
</ui> | ||
<ui control="UIGroup" name="Customize"> | ||
<ui control="UIColor" name="uColor"/> | ||
<ui control="UIFloat4" name="uUVScale" elementName="UV ScaleX;UV ScaleY;UV OffsetX;UV OffsetY"/> | ||
<ui control="UIFloat4" name="uUVTiling" elementName="TileX;TileY;Speed"/> | ||
</ui> | ||
</customUI> | ||
<shader type="GLSL" vs="GLSL/ProgressBarUIVS.glsl" fs="GLSL/ProgressBarUIFS.glsl"/> | ||
<shader type="HLSL" vs="HLSL/ProgressBarUIVS.hlsl" fs="HLSL/ProgressBarUIFS.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- File generated by function CMaterialManager::exportMaterial --> | ||
<Materials> | ||
<Material name='NoName' shader='BuiltIn/Shader/GUI/ProgressBarUI.xml'> | ||
<Textures> | ||
<Texture name='uTexDiffuse' path='' wrapU='0' wrapV='0'/> | ||
<Texture name='uTexTiling' path='ProgressBar.png' wrapU='0' wrapV='0'/> | ||
</Textures> | ||
<Params> | ||
<Param name='uColor' floatSize='4' floatValue='1.000000,1.000000,1.000000,1.000000'/> | ||
<Param name='uUVScale' floatSize='4' floatValue='1.000000,1.000000,0.000000,0.000000'/> | ||
<Param name='uUVTiling' floatSize='4' floatValue='10.000000,1.000000,-1.000000,0.000000'/> | ||
<Param name='uData' floatSize='4' floatValue='-1.000000,0.000000,1.000000,0.000000'/> | ||
</Params> | ||
<Properties> | ||
<Property name='ZBuffer' value='LessEqual'/> | ||
<Property name='ZWriteEnable' value='true'/> | ||
<Property name='BackfaceCulling' value='true'/> | ||
<Property name='FrontfaceCulling' value='false'/> | ||
</Properties> | ||
<Extras> | ||
<Extra name='BuiltIn/Shader/Basic/TextureColor.xml'/> | ||
<Textures> | ||
</Textures> | ||
</Extra> | ||
</Extras> | ||
</Material> | ||
</Materials> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.