Slider WIP

This commit is contained in:
maverickdgg 2023-03-30 16:56:41 +08:00
parent 3fc69890e4
commit 12bbce33e8
14 changed files with 104 additions and 29 deletions

View File

@ -0,0 +1,8 @@
- VertexShader: 46580970
FragmentShader: 35983630
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 64816540
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}

View File

@ -0,0 +1,3 @@
Name: UIMat_SliderBG
ID: 117587364
Type: 7

View File

@ -0,0 +1,11 @@
- VertexShader: 46580970
FragmentShader: 43211183
SubPass: UI
Properties:
data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 50370514
data.alpha: 1
data.beta: {x: 1, y: 1, z: 1}
data.sliderThreshold: 1
data.sliderStartColor: {x: 0.949000001, y: 0.689999998, z: 0.211999997, w: 1}
data.sliderBarColor: {x: 1, y: 1, z: 1, w: 1}

View File

@ -0,0 +1,3 @@
Name: UIMat_Slider_SFX
ID: 122820018
Type: 7

View File

@ -3,7 +3,9 @@
SubPass: UI SubPass: UI
Properties: Properties:
data.color: {x: 1, y: 1, z: 1, w: 1} data.color: {x: 1, y: 1, z: 1, w: 1}
data.textureIndex: 51995224 data.textureIndex: 50370514
data.alpha: 1 data.alpha: 1
data.beta: {x: 1, y: 1, z: 1} data.beta: {x: 1, y: 1, z: 1}
data.sliderThreshold: 1 data.sliderThreshold: 1
data.sliderStartColor: {x: 0.254901886, y: 0.321500003, z: 0.909799993, w: 1}
data.sliderBarColor: {x: 1, y: 1, z: 1, w: 1}

View File

@ -1,14 +1,14 @@
- NavData: 0 - NavData: 0
- EID: 0 - EID: 0
Name: Main Menu Canvas Name: Main Menu Canvas
IsActive: true IsActive: false
NumberOfChildren: 3 NumberOfChildren: 3
Components: Components:
Canvas Component: Canvas Component:
Canvas Width: 1920 Canvas Width: 1920
Canvas Height: 1080 Canvas Height: 1080
Scale by canvas width: false Scale by canvas width: false
IsActive: true IsActive: false
Scripts: ~ Scripts: ~
- EID: 1 - EID: 1
Name: BackGround Name: BackGround
@ -38,7 +38,7 @@
Transform Component: Transform Component:
Translate: {x: 0, y: 100, z: 0.300000012} Translate: {x: 0, y: 100, z: 0.300000012}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 600, y: 600, z: 1.18585491} Scale: {x: 631.577454, y: 631.577454, z: 1.24826539}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
@ -258,7 +258,7 @@
Transform Component: Transform Component:
Translate: {x: 450, y: 0, z: 0.400000006} Translate: {x: 450, y: 0, z: 0.400000006}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 400, y: 100, z: 1} Scale: {x: 389.627228, y: 97.4068069, z: 0.974068105}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
@ -533,14 +533,14 @@
Enabled: true Enabled: true
- EID: 19 - EID: 19
Name: Options Canvas Name: Options Canvas
IsActive: false IsActive: true
NumberOfChildren: 12 NumberOfChildren: 12
Components: Components:
Canvas Component: Canvas Component:
Canvas Width: 1920 Canvas Width: 1920
Canvas Height: 1080 Canvas Height: 1080
Scale by canvas width: false Scale by canvas width: false
IsActive: false IsActive: true
Scripts: Scripts:
- Type: SHADE_Scripting.UI.Options - Type: SHADE_Scripting.UI.Options
Enabled: true Enabled: true
@ -749,16 +749,16 @@
- EID: 29 - EID: 29
Name: Master Volume Slider Name: Master Volume Slider
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 1
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: 0, z: 0} Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1000, y: 75, z: 1} Scale: {x: 1024, y: 64, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
Material: 128676209 Material: 127128823
IsActive: true IsActive: true
Slider Component: Slider Component:
Slider Value: 1 Slider Value: 1
@ -771,19 +771,39 @@
Clicked: false Clicked: false
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 30 - EID: 437
Name: SFX Volume Slider Name: Slider BG
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
Components: Components:
Transform Component: Transform Component:
Translate: {x: 0, y: -100, z: 0} Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0} Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1000, y: 75, z: 1} Scale: {x: 1.01999998, y: 1.20000005, z: 1}
IsActive: true IsActive: true
Renderable Component: Renderable Component:
Mesh: 141771688 Mesh: 141771688
Material: 128676209 Material: 117587364
IsActive: true
UI Component:
Canvas ID: 19
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 30
Name: SFX Volume Slider
IsActive: true
NumberOfChildren: 1
Components:
Transform Component:
Translate: {x: 0, y: -100, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1024, y: 64, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 122820018
IsActive: true IsActive: true
Slider Component: Slider Component:
Slider Value: 1 Slider Value: 1
@ -796,6 +816,26 @@
Clicked: false Clicked: false
IsActive: true IsActive: true
Scripts: ~ Scripts: ~
- EID: 436
Name: Slider BG
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0.100000001}
Rotate: {x: 0, y: 0, z: 0}
Scale: {x: 1.01999998, y: 1.20000005, z: 1}
IsActive: true
Renderable Component:
Mesh: 141771688
Material: 117587364
IsActive: true
UI Component:
Canvas ID: 19
Hovered: false
Clicked: false
IsActive: true
Scripts: ~
- EID: 31 - EID: 31
Name: BGM Volume Slider Name: BGM Volume Slider
IsActive: true IsActive: true
@ -956,7 +996,7 @@
Material: 128676209 Material: 128676209
IsActive: true IsActive: true
Slider Component: Slider Component:
Slider Value: 1 Slider Value: 0.889483869
Min Value: 30 Min Value: 30
Max Value: 120 Max Value: 120
IsActive: true IsActive: true
@ -1142,7 +1182,7 @@
Scale: {x: 75, y: 75, z: 1} Scale: {x: 75, y: 75, z: 1}
IsActive: true IsActive: true
Text Renderer Component: Text Renderer Component:
Text: 100 Text: 60
Font: 174412429 Font: 174412429
Color: {x: 0, y: 0, z: 0, w: 1} Color: {x: 0, y: 0, z: 0, w: 1}
Text Size: {x: 1, y: 1, z: 1} Text Size: {x: 1, y: 1, z: 1}
@ -1504,14 +1544,14 @@
sceneID: 88928066 sceneID: 88928066
- EID: 450 - EID: 450
Name: TransitionCanvas Name: TransitionCanvas
IsActive: true IsActive: false
NumberOfChildren: 1 NumberOfChildren: 1
Components: Components:
Canvas Component: Canvas Component:
Canvas Width: 1920 Canvas Width: 1920
Canvas Height: 1080 Canvas Height: 1080
Scale by canvas width: false Scale by canvas width: false
IsActive: true IsActive: false
Scripts: ~ Scripts: ~
- EID: 65982 - EID: 65982
Name: Transition Name: Transition
@ -1535,6 +1575,6 @@
Scripts: Scripts:
- Type: SHADE_Scripting.UI.SceneFadeInOut - Type: SHADE_Scripting.UI.SceneFadeInOut
Enabled: true Enabled: true
alphaValue: 1 alphaValue: 0
fadeInTime: 0.5 fadeInTime: 0.5
fadeOutTime: 0.5 fadeOutTime: 0.5

View File

@ -42,19 +42,21 @@ layout(location = 1) out uint outEntityID;
void main() void main()
{ {
//fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); //fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
if (In.uv.x > MatProp.data[In2.materialIndex].sliderThreshold)
fragColor = MatProp.data[In2.materialIndex].sliderBarColor;
else
//fragColor = (1.0f - In.uv.x) * MatProp.data[In2.materialIndex].sliderStartColor + In.uv.x * MatProp.data[In2.materialIndex].sliderEndColor;
fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
if (fragColor.a < 0.01f) if (fragColor.a < 0.01f)
{ {
discard; discard;
} }
if (In.uv.x > MatProp.data[In2.materialIndex].sliderThreshold)
fragColor = MatProp.data[In2.materialIndex].sliderBarColor;
if (fragColor.xyz == vec3(0.0f, 0.0f, 0.0f))
fragColor.xyz = MatProp.data[In2.materialIndex].sliderStartColor.xyz;
fragColor.a = MatProp.data[In2.materialIndex].alpha; fragColor.a = MatProp.data[In2.materialIndex].alpha;
// fragColor.a = 1.0f; // fragColor.a = 1.0f;

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: slider_bg
ID: 64816540
Type: 3

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,3 @@
Name: slider_fill_black
ID: 50370514
Type: 3