Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MingSnake_241120
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
MingSnake_241120
Commits
2a62f6d9
Commit
2a62f6d9
authored
Nov 25, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
db5f8677
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
322 additions
and
152 deletions
+322
-152
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+1
-1
Snake.ts
assets/Scripts/Scenes/MainGame/Snake.ts
+1
-0
Mult-effect.effect
assets/resources/MultTextures/Mult-effect.effect
+16
-16
MultTextures.ts
assets/resources/MultTextures/MultTextures.ts
+304
-135
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
2a62f6d9
...
...
@@ -1514,7 +1514,7 @@
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width":
106
,
"width":
58
,
"height": 58
},
"_anchorPoint": {
...
...
assets/Scripts/Scenes/MainGame/Snake.ts
View file @
2a62f6d9
...
...
@@ -283,6 +283,7 @@ export class Snake extends Component {
);
this
.
head
.
setPosition
(
newHeadPos
);
this
.
head
.
setScale
(
this
.
scale
,
this
.
scale
);
this
.
head
.
setSiblingIndex
(
this
.
bodyArr
.
length
);
const
space
=
~~
(
this
.
SEGMENT_SPACING
*
this
.
scale
);
...
...
assets/resources/MultTextures/Mult-effect.effect
View file @
2a62f6d9
...
...
@@ -39,8 +39,8 @@ CCProgram sprite-vs %{
in vec2 a_texCoord;
in vec4 a_color;
out vec4 color;
out vec3 uv0;
out
lowp
vec4 color;
out
mediump
vec3 uv0;
vec4 vert () {
vec4 pos = vec4(a_position, 1);
...
...
@@ -57,11 +57,11 @@ CCProgram sprite-vs %{
pos = cc_matViewProj * pos;
#endif
// uv0 = a_texCoord;
float id = mod(a_texCoord.x,10.0);
uv0.x = (a_texCoord.x - id)*0.000001;
uv0.y = a_texCoord.y;
uv0.z = id;
uv0.z = mod(a_texCoord.x,10.0);
//uv0.z = fract(a_texCoord.x*0.1);
//uv0.z = floor(uv0.z*10.0+0.1);
uv0.x = (a_texCoord.x-uv0.z)*0.000001;
#if SAMPLE_FROM_RT
CC_HANDLE_RT_SAMPLE_FLIP(uv0.xy);
...
...
@@ -73,14 +73,14 @@ CCProgram sprite-vs %{
}%
CCProgram sprite-fs %{
precision
high
p float;
precision
medium
p float;
#include <builtin/internal/embedded-alpha>
#include <builtin/internal/alpha-test>
in vec4 color;
in
lowp
vec4 color;
#if USE_TEXTURE
in vec3 uv0;
in
mediump
vec3 uv0;
#pragma builtin(local)
layout(set = 2, binding = 12) uniform sampler2D cc_spriteTexture;
uniform sampler2D texture1;
...
...
@@ -96,19 +96,19 @@ CCProgram sprite-fs %{
vec4 o = vec4(1, 1, 1, 1);
#if USE_TEXTURE
if(uv0.z
<0.5
)
if(uv0.z
== 0.0
)
o *= CCSampleWithAlphaSeparated(cc_spriteTexture, uv0.xy);
else if(uv0.z
<1.5
)
else if(uv0.z
== 1.0
)
o *= CCSampleWithAlphaSeparated(texture1, uv0.xy);
else if(uv0.z
<2.5
)
else if(uv0.z
== 2.0
)
o *= CCSampleWithAlphaSeparated(texture2, uv0.xy);
else if(uv0.z
<3.5
)
else if(uv0.z
== 3.0
)
o *= CCSampleWithAlphaSeparated(texture3, uv0.xy);
else if(uv0.z
<4.5
)
else if(uv0.z
== 4.0
)
o *= CCSampleWithAlphaSeparated(texture4, uv0.xy);
else if(uv0.z
<5.5
)
else if(uv0.z
== 5.0
)
o *= CCSampleWithAlphaSeparated(texture5, uv0.xy);
else if(uv0.z
<6.5
)
else if(uv0.z
== 6.0
)
o *= CCSampleWithAlphaSeparated(texture6, uv0.xy);
else
o *= CCSampleWithAlphaSeparated(texture7, uv0.xy);
...
...
assets/resources/MultTextures/MultTextures.ts
View file @
2a62f6d9
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment