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
d35ef6ed
Commit
d35ef6ed
authored
Dec 03, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
f8d4b961
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
100 deletions
+72
-100
Svga.ts
assets/Component/Svga/Svga.ts
+1
-1
loadSvga.ts
assets/Component/Svga/loadSvga.ts
+2
-1
Mult-effect.effect
assets/resources/MultTextures/Mult-effect.effect
+8
-9
MultTextures.ts
assets/resources/MultTextures/MultTextures.ts
+61
-89
No files found.
assets/Component/Svga/Svga.ts
View file @
d35ef6ed
...
@@ -250,7 +250,6 @@ export default class Svga extends Component {
...
@@ -250,7 +250,6 @@ export default class Svga extends Component {
src
=
'data:image/png;base64,'
+
src
;
src
=
'data:image/png;base64,'
+
src
;
}
}
ps
.
push
(
ps
.
push
(
createSpriteFrameAsync
(
src
).
then
((
sp
)
=>
{
createSpriteFrameAsync
(
src
).
then
((
sp
)
=>
{
vm
[
"textures"
][
key
]
=
sp
;
vm
[
"textures"
][
key
]
=
sp
;
})
})
...
@@ -264,6 +263,7 @@ export default class Svga extends Component {
...
@@ -264,6 +263,7 @@ export default class Svga extends Component {
);
);
}
else
{
}
else
{
const
texture
=
new
Texture2D
();
const
texture
=
new
Texture2D
();
texture
.
setWrapMode
(
Texture2D
.
WrapMode
.
CLAMP_TO_EDGE
,
Texture2D
.
WrapMode
.
CLAMP_TO_EDGE
,
Texture2D
.
WrapMode
.
CLAMP_TO_EDGE
);
texture
.
image
=
new
ImageAsset
(
src
);
texture
.
image
=
new
ImageAsset
(
src
);
const
spr
=
new
SpriteFrame
();
const
spr
=
new
SpriteFrame
();
spr
.
texture
=
texture
;
spr
.
texture
=
texture
;
...
...
assets/Component/Svga/loadSvga.ts
View file @
d35ef6ed
import
{
assetManager
,
ImageAsset
,
SpriteFrame
,
Texture2D
}
from
"cc"
;
import
{
assetManager
,
ImageAsset
,
SpriteFrame
,
Texture2D
}
from
"cc"
;
const
loadCache
=
{};
const
loadCache
=
{};
...
@@ -53,6 +53,7 @@ export async function createSpriteFrameAsync(src) {
...
@@ -53,6 +53,7 @@ export async function createSpriteFrameAsync(src) {
const
img
=
await
createImageAsync
(
src
);
const
img
=
await
createImageAsync
(
src
);
const
texture
=
new
Texture2D
();
const
texture
=
new
Texture2D
();
texture
.
setWrapMode
(
Texture2D
.
WrapMode
.
CLAMP_TO_EDGE
,
Texture2D
.
WrapMode
.
CLAMP_TO_EDGE
,
Texture2D
.
WrapMode
.
CLAMP_TO_EDGE
);
texture
.
image
=
new
ImageAsset
(
img
);
texture
.
image
=
new
ImageAsset
(
img
);
const
sp
=
new
SpriteFrame
();
const
sp
=
new
SpriteFrame
();
sp
.
texture
=
texture
;
sp
.
texture
=
texture
;
...
...
assets/resources/MultTextures/Mult-effect.effect
View file @
d35ef6ed
...
@@ -59,8 +59,7 @@ CCProgram sprite-vs %{
...
@@ -59,8 +59,7 @@ CCProgram sprite-vs %{
uv0.y = a_texCoord.y;
uv0.y = a_texCoord.y;
uv0.z = mod(a_texCoord.x,10.0);
uv0.z = mod(a_texCoord.x,10.0);
//uv0.z = fract(a_texCoord.x*0.1);
//uv0.z = fract(a_texCoord.x*0.1)*10.0;
//uv0.z = floor(uv0.z*10.0+0.1);
uv0.x = (a_texCoord.x-uv0.z)*0.000001;
uv0.x = (a_texCoord.x-uv0.z)*0.000001;
#if SAMPLE_FROM_RT
#if SAMPLE_FROM_RT
...
@@ -96,19 +95,19 @@ CCProgram sprite-fs %{
...
@@ -96,19 +95,19 @@ CCProgram sprite-fs %{
vec4 o = vec4(1, 1, 1, 1);
vec4 o = vec4(1, 1, 1, 1);
#if USE_TEXTURE
#if USE_TEXTURE
if(uv0.z
== 0.0
)
if(uv0.z
< 0.5
)
o *= CCSampleWithAlphaSeparated(cc_spriteTexture, uv0.xy);
o *= CCSampleWithAlphaSeparated(cc_spriteTexture, uv0.xy);
else if(uv0.z
== 1.0
)
else if(uv0.z
< 1.5
)
o *= CCSampleWithAlphaSeparated(texture1, uv0.xy);
o *= CCSampleWithAlphaSeparated(texture1, uv0.xy);
else if(uv0.z
== 2.0
)
else if(uv0.z
< 2.5
)
o *= CCSampleWithAlphaSeparated(texture2, uv0.xy);
o *= CCSampleWithAlphaSeparated(texture2, uv0.xy);
else if(uv0.z
== 3.0
)
else if(uv0.z
< 3.5
)
o *= CCSampleWithAlphaSeparated(texture3, uv0.xy);
o *= CCSampleWithAlphaSeparated(texture3, uv0.xy);
else if(uv0.z
== 4.0
)
else if(uv0.z
< 4.5
)
o *= CCSampleWithAlphaSeparated(texture4, uv0.xy);
o *= CCSampleWithAlphaSeparated(texture4, uv0.xy);
else if(uv0.z
== 5.0
)
else if(uv0.z
< 5.5
)
o *= CCSampleWithAlphaSeparated(texture5, uv0.xy);
o *= CCSampleWithAlphaSeparated(texture5, uv0.xy);
else if(uv0.z
== 6.0
)
else if(uv0.z
< 6.5
)
o *= CCSampleWithAlphaSeparated(texture6, uv0.xy);
o *= CCSampleWithAlphaSeparated(texture6, uv0.xy);
else
else
o *= CCSampleWithAlphaSeparated(texture7, uv0.xy);
o *= CCSampleWithAlphaSeparated(texture7, uv0.xy);
...
...
assets/resources/MultTextures/MultTextures.ts
View file @
d35ef6ed
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