From cb58fcbff867d744a923b440238bad76fed47a64 Mon Sep 17 00:00:00 2001 From: ruanwujing <1220792244@qq.com> Date: Wed, 31 Jan 2024 15:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84sdf?= =?UTF-8?q?=E8=A3=81=E5=88=87=E5=BD=A2=E7=8A=B6=E7=A4=BA=E4=BE=8B=EF=BC=9B?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BD=A2=E7=8A=B6=E8=B0=83=E8=8A=82=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/resources/chunks/sdf2d.chunk | 3 + .../effects/color_sdf2d_circle.effect | 10 +- .../effects/color_sdf2d_heart.effect | 93 ++ .../effects/color_sdf2d_heart.effect.meta | 11 + .../effects/color_sdf2d_star5.effect | 100 ++ .../effects/color_sdf2d_star5.effect.meta | 11 + assets/resources/materials.meta | 9 + .../materials/color_sdf2d_circle.mtl | 10 +- .../resources/materials/color_sdf2d_heart.mtl | 39 + .../materials/color_sdf2d_heart.mtl.meta | 11 + .../resources/materials/color_sdf2d_star5.mtl | 39 + .../materials/color_sdf2d_star5.mtl.meta | 11 + assets/resources/scenes/sdf2d_shapes.scene | 876 ++++++++++++++++++ .../resources/scenes/sdf2d_shapes.scene.meta | 11 + 14 files changed, 1231 insertions(+), 3 deletions(-) create mode 100644 assets/resources/effects/color_sdf2d_heart.effect create mode 100644 assets/resources/effects/color_sdf2d_heart.effect.meta create mode 100644 assets/resources/effects/color_sdf2d_star5.effect create mode 100644 assets/resources/effects/color_sdf2d_star5.effect.meta create mode 100644 assets/resources/materials.meta create mode 100644 assets/resources/materials/color_sdf2d_heart.mtl create mode 100644 assets/resources/materials/color_sdf2d_heart.mtl.meta create mode 100644 assets/resources/materials/color_sdf2d_star5.mtl create mode 100644 assets/resources/materials/color_sdf2d_star5.mtl.meta create mode 100644 assets/resources/scenes/sdf2d_shapes.scene create mode 100644 assets/resources/scenes/sdf2d_shapes.scene.meta diff --git a/assets/resources/chunks/sdf2d.chunk b/assets/resources/chunks/sdf2d.chunk index 52d0d58..d7a3488 100644 --- a/assets/resources/chunks/sdf2d.chunk +++ b/assets/resources/chunks/sdf2d.chunk @@ -1,3 +1,6 @@ +float dot2(vec2 p) { + return dot(p, p); +} float sdCircle( vec2 p, float r ) { return length(p) - r; diff --git a/assets/resources/effects/color_sdf2d_circle.effect b/assets/resources/effects/color_sdf2d_circle.effect index 77b0544..6b3a249 100644 --- a/assets/resources/effects/color_sdf2d_circle.effect +++ b/assets/resources/effects/color_sdf2d_circle.effect @@ -17,6 +17,8 @@ CCEffect %{ cullMode: none properties: alphaThreshold: { value: 0.5 } + circleParams: { value:[0.5, 0.01, -0.01, 0.0]} + }% CCProgram sprite-vs %{ @@ -67,6 +69,10 @@ CCProgram sprite-fs %{ #include "../chunks/sdf2d" in vec4 color; + uniform Constant { + vec4 circleParams; + }; + #if USE_TEXTURE in vec2 uv0; #pragma builtin(local) @@ -85,8 +91,8 @@ CCProgram sprite-fs %{ #endif vec2 uv = (uv0 - color.xy) / color.zw; - float d = sdCircle(uv - 0.5, 0.5); - float c = smoothstep(0.01, -0.01, d); + float d = sdCircle(uv - 0.5, circleParams.x); + float c = smoothstep(circleParams.y, circleParams.z, d); o.a *= c; ALPHA_TEST(o); return o; diff --git a/assets/resources/effects/color_sdf2d_heart.effect b/assets/resources/effects/color_sdf2d_heart.effect new file mode 100644 index 0000000..bca2060 --- /dev/null +++ b/assets/resources/effects/color_sdf2d_heart.effect @@ -0,0 +1,93 @@ +// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd. +CCEffect %{ + techniques: + - passes: + - vert: sprite-vs:vert + frag: sprite-fs:frag + depthStencilState: + depthTest: false + depthWrite: false + blendState: + targets: + - blend: true + blendSrc: src_alpha + blendDst: one_minus_src_alpha + blendDstAlpha: one_minus_src_alpha + rasterizerState: + cullMode: none + properties: + params: { value:[0.5, 0.5, 0.01, -0.01]} + +}% + +CCProgram sprite-vs %{ + precision highp float; + #include + #if USE_LOCAL + #include + #endif + #if SAMPLE_FROM_RT + #include + #endif + in vec3 a_position; + in vec2 a_texCoord; + in vec4 a_color; + + out vec4 color; + out vec2 uv0; + + vec4 vert () { + vec4 pos = vec4(a_position, 1); + + #if USE_LOCAL + pos = cc_matWorld * pos; + #endif + + #if USE_PIXEL_ALIGNMENT + pos = cc_matView * pos; + pos.xyz = floor(pos.xyz); + pos = cc_matProj * pos; + #else + pos = cc_matViewProj * pos; + #endif + + uv0 = a_texCoord; + #if SAMPLE_FROM_RT + CC_HANDLE_RT_SAMPLE_FLIP(uv0); + #endif + color = a_color; + + return pos; + } +}% + +CCProgram sprite-fs %{ + precision highp float; + #include + #include "../chunks/sdf2d" + in vec4 color; + + uniform Constant { + vec4 params; + }; + + + in vec2 uv0; + #pragma builtin(local) + layout(set = 2, binding = 12) uniform sampler2D cc_spriteTexture; + + vec4 frag () { + vec4 o = vec4(1, 1, 1, 1); + + o *= CCSampleWithAlphaSeparated(cc_spriteTexture, uv0); + + vec2 uv = (uv0 - color.xy) / color.zw; + #if UP_SIDE_DOWN + uv.y = 1.0 - uv.y; + #endif + float d = sdHeart((uv + vec2(-0.5, params.y)) / params.x); + float c = smoothstep(params.z, params.w, d); + o.a *= c; + return o; + } +}% \ No newline at end of file diff --git a/assets/resources/effects/color_sdf2d_heart.effect.meta b/assets/resources/effects/color_sdf2d_heart.effect.meta new file mode 100644 index 0000000..efb4a46 --- /dev/null +++ b/assets/resources/effects/color_sdf2d_heart.effect.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.7.1", + "importer": "effect", + "imported": true, + "uuid": "fef16f75-0140-40d5-97b8-99185849b0e8", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/effects/color_sdf2d_star5.effect b/assets/resources/effects/color_sdf2d_star5.effect new file mode 100644 index 0000000..fc6472a --- /dev/null +++ b/assets/resources/effects/color_sdf2d_star5.effect @@ -0,0 +1,100 @@ +// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd. +CCEffect %{ + techniques: + - passes: + - vert: sprite-vs:vert + frag: sprite-fs:frag + depthStencilState: + depthTest: false + depthWrite: false + blendState: + targets: + - blend: true + blendSrc: src_alpha + blendDst: one_minus_src_alpha + blendDstAlpha: one_minus_src_alpha + rasterizerState: + cullMode: none + properties: + alphaThreshold: { value: 0.5 } + star5Params: { value:[0.5, 0.5, 0.01, -0.01]} + +}% + +CCProgram sprite-vs %{ + precision highp float; + #include + #if USE_LOCAL + #include + #endif + #if SAMPLE_FROM_RT + #include + #endif + in vec3 a_position; + in vec2 a_texCoord; + in vec4 a_color; + + out vec4 color; + out vec2 uv0; + + vec4 vert () { + vec4 pos = vec4(a_position, 1); + + #if USE_LOCAL + pos = cc_matWorld * pos; + #endif + + #if USE_PIXEL_ALIGNMENT + pos = cc_matView * pos; + pos.xyz = floor(pos.xyz); + pos = cc_matProj * pos; + #else + pos = cc_matViewProj * pos; + #endif + + uv0 = a_texCoord; + #if SAMPLE_FROM_RT + CC_HANDLE_RT_SAMPLE_FLIP(uv0); + #endif + color = a_color; + + return pos; + } +}% + +CCProgram sprite-fs %{ + precision highp float; + #include + #include + #include "../chunks/sdf2d" + in vec4 color; + + uniform Constant { + vec4 star5Params; + }; + + #if USE_TEXTURE + in vec2 uv0; + #pragma builtin(local) + layout(set = 2, binding = 12) uniform sampler2D cc_spriteTexture; + #endif + + vec4 frag () { + vec4 o = vec4(1, 1, 1, 1); + + #if USE_TEXTURE + o *= CCSampleWithAlphaSeparated(cc_spriteTexture, uv0); + #if IS_GRAY + float gray = 0.2126 * o.r + 0.7152 * o.g + 0.0722 * o.b; + o.r = o.g = o.b = gray; + #endif + #endif + + + vec2 uv = (uv0 - color.xy) / color.zw; + float d = sdStar5(uv - 0.5, star5Params.x, star5Params.y); + float c = smoothstep(star5Params.z, star5Params.w, d); + o.a *= c; + return o; + } +}% \ No newline at end of file diff --git a/assets/resources/effects/color_sdf2d_star5.effect.meta b/assets/resources/effects/color_sdf2d_star5.effect.meta new file mode 100644 index 0000000..8b81f4d --- /dev/null +++ b/assets/resources/effects/color_sdf2d_star5.effect.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.7.1", + "importer": "effect", + "imported": true, + "uuid": "254577e6-4c95-47b4-9cb2-36ec930c286d", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/materials.meta b/assets/resources/materials.meta new file mode 100644 index 0000000..8e05468 --- /dev/null +++ b/assets/resources/materials.meta @@ -0,0 +1,9 @@ +{ + "ver": "1.2.0", + "importer": "directory", + "imported": true, + "uuid": "d49ab581-bc36-441f-b272-f43a0cfd0398", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/materials/color_sdf2d_circle.mtl b/assets/resources/materials/color_sdf2d_circle.mtl index 0a4dcab..4a78448 100644 --- a/assets/resources/materials/color_sdf2d_circle.mtl +++ b/assets/resources/materials/color_sdf2d_circle.mtl @@ -26,6 +26,14 @@ } ], "_props": [ - {} + { + "circleParams": { + "__type__": "cc.Vec4", + "x": 0.4, + "y": 0.11, + "z": -0.01, + "w": 0 + } + } ] } \ No newline at end of file diff --git a/assets/resources/materials/color_sdf2d_heart.mtl b/assets/resources/materials/color_sdf2d_heart.mtl new file mode 100644 index 0000000..daed354 --- /dev/null +++ b/assets/resources/materials/color_sdf2d_heart.mtl @@ -0,0 +1,39 @@ +{ + "__type__": "cc.Material", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "_effectAsset": { + "__uuid__": "fef16f75-0140-40d5-97b8-99185849b0e8", + "__expectedType__": "cc.EffectAsset" + }, + "_techIdx": 0, + "_defines": [ + { + "UP_SIDE_DOWN": true + } + ], + "_states": [ + { + "rasterizerState": {}, + "depthStencilState": {}, + "blendState": { + "targets": [ + {} + ] + } + } + ], + "_props": [ + { + "params": { + "__type__": "cc.Vec4", + "x": 0.6, + "y": -0.2, + "z": 0.11, + "w": -0.01 + } + } + ] +} \ No newline at end of file diff --git a/assets/resources/materials/color_sdf2d_heart.mtl.meta b/assets/resources/materials/color_sdf2d_heart.mtl.meta new file mode 100644 index 0000000..7ec71b9 --- /dev/null +++ b/assets/resources/materials/color_sdf2d_heart.mtl.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.0.21", + "importer": "material", + "imported": true, + "uuid": "e6cd9948-ab5d-4816-8523-68f13f4ed20f", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/materials/color_sdf2d_star5.mtl b/assets/resources/materials/color_sdf2d_star5.mtl new file mode 100644 index 0000000..80e54f1 --- /dev/null +++ b/assets/resources/materials/color_sdf2d_star5.mtl @@ -0,0 +1,39 @@ +{ + "__type__": "cc.Material", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "_effectAsset": { + "__uuid__": "254577e6-4c95-47b4-9cb2-36ec930c286d", + "__expectedType__": "cc.EffectAsset" + }, + "_techIdx": 0, + "_defines": [ + { + "USE_TEXTURE": true + } + ], + "_states": [ + { + "rasterizerState": {}, + "depthStencilState": {}, + "blendState": { + "targets": [ + {} + ] + } + } + ], + "_props": [ + { + "star5Params": { + "__type__": "cc.Vec4", + "x": 0.4, + "y": 0.6, + "z": 0.11, + "w": -0.01 + } + } + ] +} \ No newline at end of file diff --git a/assets/resources/materials/color_sdf2d_star5.mtl.meta b/assets/resources/materials/color_sdf2d_star5.mtl.meta new file mode 100644 index 0000000..65a8a6c --- /dev/null +++ b/assets/resources/materials/color_sdf2d_star5.mtl.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.0.21", + "importer": "material", + "imported": true, + "uuid": "25305096-8f75-413c-a292-5e3927bf0e3d", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +} diff --git a/assets/resources/scenes/sdf2d_shapes.scene b/assets/resources/scenes/sdf2d_shapes.scene new file mode 100644 index 0000000..63155e2 --- /dev/null +++ b/assets/resources/scenes/sdf2d_shapes.scene @@ -0,0 +1,876 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "sdf2d_shapes", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_name": "sdf2d_shapes", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + }, + { + "__id__": 5 + } + ], + "_active": true, + "_components": [], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "autoReleaseAssets": false, + "_globals": { + "__id__": 20 + }, + "_id": "d3d4c22a-8da8-4e57-94c4-1cfa29c09130" + }, + { + "__type__": "cc.Node", + "_name": "Main Light", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 3 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": -0.06397656665577071, + "y": -0.44608233363525845, + "z": -0.8239028751062036, + "w": -0.3436591377065261 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": -117.894, + "y": -194.909, + "z": 38.562 + }, + "_id": "c0y6F5f+pAvI805TdmxIjx" + }, + { + "__type__": "cc.DirectionalLight", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": null, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 250, + "b": 240, + "a": 255 + }, + "_useColorTemperature": false, + "_colorTemperature": 6550, + "_staticSettings": { + "__id__": 4 + }, + "_visibility": -325058561, + "_illuminanceHDR": 65000, + "_illuminance": 65000, + "_illuminanceLDR": 1.6927083333333335, + "_shadowEnabled": false, + "_shadowPcf": 0, + "_shadowBias": 0.00001, + "_shadowNormalBias": 0, + "_shadowSaturation": 1, + "_shadowDistance": 50, + "_shadowInvisibleOcclusionRange": 200, + "_csmLevel": 4, + "_csmLayerLambda": 0.75, + "_csmOptimizationMode": 2, + "_csmAdvancedOptions": false, + "_csmLayersTransition": false, + "_csmTransitionRange": 0.05, + "_shadowFixedArea": false, + "_shadowNear": 0.1, + "_shadowFar": 10, + "_shadowOrthoSize": 5, + "_id": "597uMYCbhEtJQc0ffJlcgA" + }, + { + "__type__": "cc.StaticLightSettings", + "_baked": false, + "_editorOnly": false, + "_castShadow": false + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 6 + }, + { + "__id__": 8 + }, + { + "__id__": 11 + }, + { + "__id__": 14 + } + ], + "_active": true, + "_components": [ + { + "__id__": 17 + }, + { + "__id__": 18 + }, + { + "__id__": 19 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 640, + "y": 360, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "9dU2PuW7xAarkecYHjURjJ" + }, + { + "__type__": "cc.Node", + "_name": "Camera", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 7 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 1000 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "b8uomvAn1JbaD0qW2jTUm6" + }, + { + "__type__": "cc.Camera", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 6 + }, + "_enabled": true, + "__prefab": null, + "_projection": 0, + "_priority": 1073741824, + "_fov": 45, + "_fovAxis": 0, + "_orthoHeight": 422.9685807150596, + "_near": 1, + "_far": 2000, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_depth": 1, + "_stencil": 0, + "_clearFlags": 6, + "_rect": { + "__type__": "cc.Rect", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + "_aperture": 19, + "_shutter": 7, + "_iso": 0, + "_screenScale": 1, + "_visibility": 41943040, + "_targetTexture": null, + "_postProcess": null, + "_usePostProcess": false, + "_cameraType": -1, + "_trackingType": 0, + "_id": "c1O4N0cxpDoYE96b5a6xlg" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 9 + }, + { + "__id__": 10 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 128.254, + "y": 153.905, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "91nEUUXNFNeaXIWJHtM7m+" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 8 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 753.4423828125, + "height": 50.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "f3Wy0Amg5B1YDDrFmvh+pu" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 8 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "五星和爱心示例,更多的请自己看sdf2dchunk里自己封装", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 30, + "_fontSize": 30, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_id": "3dMzBI8udBKaidZYu4LF5/" + }, + { + "__type__": "cc.Node", + "_name": "Node", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 12 + }, + { + "__id__": 13 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "a5/PGXdkJN+5XefAZuKv6P" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 11 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "0bbxYvJhpENam7XtD8DZ8V" + }, + { + "__type__": "6845d+/NTJDrKyRKBO2mDiC", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 11 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": { + "__uuid__": "25305096-8f75-413c-a292-5e3927bf0e3d", + "__expectedType__": "cc.Material" + }, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 255, + "a": 255 + }, + "_sizeMode": 1, + "_atlas": null, + "_spriteFrame": { + "__uuid__": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_id": "dc2Uos1Z1OhZpLzi6AahyD" + }, + { + "__type__": "cc.Node", + "_name": "Node-001", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 5 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 15 + }, + { + "__id__": 16 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 250, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_mobility": 0, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "dcFRSxTIBCSJprfa/oYBAI" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 14 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "92yAlvVFlBt4rOWp4hTBr3" + }, + { + "__type__": "6845d+/NTJDrKyRKBO2mDiC", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 14 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": { + "__uuid__": "e6cd9948-ab5d-4816-8523-68f13f4ed20f", + "__expectedType__": "cc.Material" + }, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 255, + "a": 255 + }, + "_sizeMode": 1, + "_atlas": null, + "_spriteFrame": { + "__uuid__": "890f043a-8cad-46e4-b5b1-584554c0cad1@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_id": "1cZ7wZwCFJ0JEF9qXnU51N" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 1280, + "height": 720 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "beLOPRwp5Ng6GXFSXPhX4Y" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "_cameraComponent": { + "__id__": 7 + }, + "_alignCanvasWithScreen": true, + "_id": "d8CQKrtKNCx4SjqUwP0g0k" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 5 + }, + "_enabled": true, + "__prefab": null, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "81A4gWDP9MGYrEzIbx8AsL" + }, + { + "__type__": "cc.SceneGlobals", + "ambient": { + "__id__": 21 + }, + "shadows": { + "__id__": 22 + }, + "_skybox": { + "__id__": 23 + }, + "fog": { + "__id__": 24 + }, + "octree": { + "__id__": 25 + }, + "skin": { + "__id__": 26 + }, + "lightProbeInfo": { + "__id__": 27 + }, + "postSettings": { + "__id__": 28 + }, + "bakedWithStationaryMainLight": false, + "bakedWithHighpLightmap": false + }, + { + "__type__": "cc.AmbientInfo", + "_skyColorHDR": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.5, + "z": 0.8, + "w": 0.520833125 + }, + "_skyColor": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.5, + "z": 0.8, + "w": 0.520833125 + }, + "_skyIllumHDR": 20000, + "_skyIllum": 20000, + "_groundAlbedoHDR": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.2, + "z": 0.2, + "w": 1 + }, + "_groundAlbedo": { + "__type__": "cc.Vec4", + "x": 0.2, + "y": 0.2, + "z": 0.2, + "w": 1 + }, + "_skyColorLDR": { + "__type__": "cc.Vec4", + "x": 0.452588, + "y": 0.607642, + "z": 0.755699, + "w": 0 + }, + "_skyIllumLDR": 0.8, + "_groundAlbedoLDR": { + "__type__": "cc.Vec4", + "x": 0.618555, + "y": 0.577848, + "z": 0.544564, + "w": 0 + } + }, + { + "__type__": "cc.ShadowsInfo", + "_enabled": false, + "_type": 0, + "_normal": { + "__type__": "cc.Vec3", + "x": 0, + "y": 1, + "z": 0 + }, + "_distance": 0, + "_shadowColor": { + "__type__": "cc.Color", + "r": 76, + "g": 76, + "b": 76, + "a": 255 + }, + "_maxReceived": 4, + "_size": { + "__type__": "cc.Vec2", + "x": 1024, + "y": 1024 + } + }, + { + "__type__": "cc.SkyboxInfo", + "_envLightingType": 0, + "_envmapHDR": { + "__uuid__": "d032ac98-05e1-4090-88bb-eb640dcb5fc1@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_envmap": { + "__uuid__": "d032ac98-05e1-4090-88bb-eb640dcb5fc1@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_envmapLDR": { + "__uuid__": "6f01cf7f-81bf-4a7e-bd5d-0afc19696480@b47c0", + "__expectedType__": "cc.TextureCube" + }, + "_diffuseMapHDR": null, + "_diffuseMapLDR": null, + "_enabled": true, + "_useHDR": true, + "_editableMaterial": null, + "_reflectionHDR": null, + "_reflectionLDR": null, + "_rotationAngle": 0 + }, + { + "__type__": "cc.FogInfo", + "_type": 0, + "_fogColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_enabled": false, + "_fogDensity": 0.3, + "_fogStart": 0.5, + "_fogEnd": 300, + "_fogAtten": 5, + "_fogTop": 1.5, + "_fogRange": 1.2, + "_accurate": false + }, + { + "__type__": "cc.OctreeInfo", + "_enabled": false, + "_minPos": { + "__type__": "cc.Vec3", + "x": -1024, + "y": -1024, + "z": -1024 + }, + "_maxPos": { + "__type__": "cc.Vec3", + "x": 1024, + "y": 1024, + "z": 1024 + }, + "_depth": 8 + }, + { + "__type__": "cc.SkinInfo", + "_enabled": true, + "_blurRadius": 0.01, + "_sssIntensity": 3 + }, + { + "__type__": "cc.LightProbeInfo", + "_giScale": 1, + "_giSamples": 1024, + "_bounces": 2, + "_reduceRinging": 0, + "_showProbe": true, + "_showWireframe": true, + "_showConvex": false, + "_data": null, + "_lightProbeSphereVolume": 1 + }, + { + "__type__": "cc.PostSettingsInfo", + "_toneMappingType": 0 + } +] \ No newline at end of file diff --git a/assets/resources/scenes/sdf2d_shapes.scene.meta b/assets/resources/scenes/sdf2d_shapes.scene.meta new file mode 100644 index 0000000..e8f69ea --- /dev/null +++ b/assets/resources/scenes/sdf2d_shapes.scene.meta @@ -0,0 +1,11 @@ +{ + "ver": "1.1.49", + "importer": "scene", + "imported": true, + "uuid": "d3d4c22a-8da8-4e57-94c4-1cfa29c09130", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": {} +}