GamesData/GameUploadDocuments/2.StepOfDoom/Build/jsb-link/res/import/6d/6d91e591-4ce0-465c-809f-610ec95019c6.json

1 line
12 KiB
JSON
Raw Normal View History

2025-07-03 12:35:09 +04:00
{"__type__":"cc.EffectAsset","_name":"builtin-unlit","properties":{"diffuseTexture":{"type":13,"value":null},"diffuseColor":{"type":9,"value":[1,1,1,1]},"alphaThreshold":{"value":0.5}},"techniques":[{"passes":[{"cullMode":0,"depthTest":true,"depthWrite":true,"blend":true,"program":"8af5ee8040d8725057e4d5f8bac775803dac5e5263fc2495a0b4cc79"}],"layer":0,"stages":["opaque"],"queue":0,"priority":0}],"shaders":[{"vert":"\n#define _IS_VERT_SHADER 1\n\nprecision highp float;\n\nuniform mat4 cc_matWorld;\nuniform mat3 cc_matWorldIT;\n\nuniform mat4 cc_matView;\n\nuniform mat4 cc_matViewProj;\n\nuniform vec3 cc_cameraPos; \n\nuniform vec3 cc_sceneAmbient; \n\n#ifndef USE_DIFFUSE_TEXTURE\n #ifndef USE_EMISSIVE_TEXTURE\n #ifndef USE_SPECULAR_TEXTURE\n #ifndef USE_NORMAL_TEXTURE\n #define _NOT_USE_TEXTURE 1\n #endif\n #endif\n #endif\n#endif\n\n#if USE_TILING_OFFSET && _USE_ATTRIBUTE_UV0\n uniform vec2 mainTiling;\n uniform vec2 mainOffset;\n#endif\n\n#ifdef _IS_VERT_SHADER\n attribute vec3 a_position;\n#endif\n\n#ifndef _NOT_USE_TEXTURE\n\n #if _USE_ATTRIBUTE_UV0\n #ifdef _IS_VERT_SHADER\n attribute mediump vec2 a_uv0;\n #endif\n\n varying mediump vec2 v_uv0;\n #endif\n\n#endif\n\n#if _USE_ATTRIBUTE_COLOR\n\n #ifdef _IS_VERT_SHADER\n attribute lowp vec4 a_color;\n #endif\n\n varying lowp vec4 v_color;\n#endif\n\n#if _USE_ATTRIBUTE_NORMAL\n #ifdef _IS_VERT_SHADER\n attribute vec3 a_normal;\n #endif\n#endif\n\n#ifdef _IS_VERT_SHADER\n\n void ATTRIBUTE_TO_VARYING () {\n\n #if _USE_ATTRIBUTE_COLOR\n v_color = a_color;\n #endif\n\n #ifndef _NOT_USE_TEXTURE\n #if _USE_ATTRIBUTE_UV0\n v_uv0 = a_uv0;\n\n #if USE_TILING_OFFSET\n v_uv0 = v_uv0 * mainTiling + mainOffset;\n #endif\n #endif\n #endif\n\n }\n\n#endif\n\nvoid MUL_ATTR_COLOR (inout vec4 color) {\n #if _USE_ATTRIBUTE_COLOR\n #ifdef _IS_VERT_SHADER\n color *= a_color;\n #else\n color *= v_color;\n #endif\n #endif\n}\n\nvoid MUL_ATTR_NORMAL (inout vec3 normal) {\n #if _USE_ATTRIBUTE_NORMAL\n #ifdef _IS_VERT_SHADER\n normal *= a_normal;\n #endif\n #endif\n}\nvoid MUL_ATTR_NORMAL (inout vec4 normal) {\n #if _USE_ATTRIBUTE_NORMAL\n #ifdef _IS_VERT_SHADER\n normal.xyz *= a_normal;\n #endif\n #endif\n}\n\n#if _USE_SKINNING\n\n attribute vec4 a_weights;\n attribute vec4 a_joints;\n\n #if _USE_JOINTS_TEXTRUE\n uniform sampler2D _jointsTexture;\n uniform vec2 _jointsTextureSize;\n\n #if _JOINTS_TEXTURE_FLOAT32\n mat4 getBoneMatrix(const in float i) {\n float width = _jointsTextureSize.x;\n float height = _jointsTextureSize.y;\n float j = i * 4.0;\n float x = mod(j, width);\n float y = floor(j / width);\n\n float dx = 1.0 / width;\n float dy = 1.0 / height;\n\n y = dy * (y + 0.5);\n\n vec4 v1 = texture2D(_jointsTexture, vec2(dx * (x + 0.5), y));\n vec4 v2 = texture2D(_jointsTexture, vec2(dx * (x + 1.5), y));\n vec4 v3 = texture2D(_jointsTexture, vec2(dx * (x + 2.5), y));\n vec4 v4 = texture2D(_jointsTexture, vec2(dx * (x + 3.5), y));\n\n return mat4(v1, v2, v3, v4);\n }\n #else\n float decode32(vec4 rgba) {\n float Sign = 1.0 - step(128.0, rgba[0]) * 2.0;\n float Exponent = 2.0 * mod(rgba[0], 128.0) + step(128.0, rgba[1]) - 127.0;\n float Mantissa = mod(rgba[1], 128.0) * 65536.0 + rgba[2] * 256.0 + rgba[3] + 8388608.0;\n return Sign * exp2(Exponent - 23.0) * Mantissa;\n }\n vec4 decodevec4 (vec4 x, vec4 y, vec4 z, vec4 w) {\n \n return vec4(\n decode32(x.wzyx * 255.0),\n decode32(y.wzyx * 255.0),\n decode32(z.wzyx * 255.0),\n decode32(w.wzyx * 255.0)\n );\n }\n\n vec4 decodevec4 (float dx, float x, float y) {\n return decodevec4(\n texture2D(_jointsTexture, vec2(dx * (x + 0.5), y)),\n texture2D(_jointsTexture, vec2(dx * (x + 1.5), y)),\n