{ "__type__": "cc.EffectAsset", "_name": "internal/editor/box-height-light", "_objFlags": 0, "__editorExtras__": {}, "_native": "", "techniques": [ { "passes": [ { "rasterizerState": { "cullMode": 0 }, "blendState": { "targets": [ { "blend": true, "blendSrc": 2, "blendDst": 4, "blendDstAlpha": 4 } ] }, "program": "internal/editor/box-height-light|line-vs:vert|line-fs:front", "priority": 245, "depthStencilState": { "depthTest": false, "depthWrite": false }, "properties": { "selectedColor": { "value": [ 1, 1, 0, 0.0784313 ], "type": 16 }, "selectedFaceForward": { "value": [ 0, 0, 0, 0 ], "type": 16 } } } ] } ], "shaders": [ { "blocks": [ { "name": "Constant", "members": [ { "name": "mainColor", "type": 16, "count": 1 }, { "name": "selectedColor", "type": 16, "count": 1 }, { "name": "selectedFaceForward", "type": 16, "count": 1 } ], "defines": [], "stageFlags": 16, "binding": 0 } ], "samplerTextures": [], "samplers": [], "textures": [], "buffers": [], "images": [], "subpassInputs": [], "attributes": [ { "name": "a_position", "defines": [], "format": 32, "location": 0 }, { "name": "a_normal", "defines": [], "format": 32, "location": 1 }, { "name": "a_lineDistance", "defines": [ "USE_DASHED_LINE" ], "format": 11, "location": 2 } ], "varyings": [ { "name": "normal", "type": 15, "count": 1, "defines": [], "stageFlags": 17, "location": 0 }, { "name": "lineDistance", "type": 13, "count": 1, "defines": [ "USE_DASHED_LINE" ], "stageFlags": 17, "location": 1 } ], "fragColors": [ { "name": "cc_FragColor", "typename": "vec4", "type": 16, "count": 1, "defines": [], "stageFlags": 16, "location": 0 } ], "descriptors": [ { "rate": 0, "blocks": [ { "tags": { "builtin": "local" }, "name": "CCLocal", "members": [ { "name": "cc_matWorld", "typename": "mat4", "type": 25, "count": 1, "precision": "highp " }, { "name": "cc_matWorldIT", "typename": "mat4", "type": 25, "count": 1, "precision": "highp " }, { "name": "cc_lightingMapUVParam", "typename": "vec4", "type": 16, "count": 1, "precision": "highp " }, { "name": "cc_localShadowBias", "typename": "vec4", "type": 16, "count": 1, "precision": "highp " }, { "name": "cc_reflectionProbeData1", "typename": "vec4", "type": 16, "count": 1, "precision": "highp " }, { "name": "cc_reflectionProbeData2", "typename": "vec4", "type": 16, "count": 1, "precision": "highp " }, { "name": "cc_reflectionProbeBlendData1", "typename": "vec4", "type": 16, "count": 1, "precision": "highp " }, { "name": "cc_reflectionProbeBlendData2", "typename": "vec4", "type": 16, "count": 1, "precision": "highp " } ], "defines": [], "stageFlags": 1 } ], "samplerTextures": [], "samplers": [], "textures": [], "buffers": [], "images": [], "subpassInputs": [] }, { "rate": 1, "blocks": [ { "name": "Constant", "members": [ { "name": "mainColor", "type": 16, "count": 1 }, { "name": "selectedColor", "type": 16, "count": 1 }, { "name": "selectedFaceForward", "type": 16, "count": 1 } ], "defines": [], "stageFlags": 16, "binding": 0 } ], "samplerTextures": [], "samplers": [], "textures": [], "buffers": [], "images": [], "subpassInputs": [] }, { "rate": 2, "blocks": [], "samplerTextures": [], "samplers": [], "textures": [], "buffers": [], "images": [], "subpassInputs": [] }, { "rate": 3, "blocks": [ { "tags": { "builtin": "global" }, "name": "CCGlobal", "members": [ { "name": "cc_time", "typename": "vec4", "type": 16, "count": 1, "precision": "highp " }, { "name": "cc_screenSize", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_nativeSize", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_probeInfo", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_debug_view_mode", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " } ], "defines": [], "stageFlags": 17 }, { "tags": { "builtin": "global" }, "name": "CCCamera", "members": [ { "name": "cc_matView", "typename": "mat4", "type": 25, "count": 1, "precision": "highp " }, { "name": "cc_matViewInv", "typename": "mat4", "type": 25, "count": 1, "precision": "highp " }, { "name": "cc_matProj", "typename": "mat4", "type": 25, "count": 1, "precision": "highp " }, { "name": "cc_matProjInv", "typename": "mat4", "type": 25, "count": 1, "precision": "highp " }, { "name": "cc_matViewProj", "typename": "mat4", "type": 25, "count": 1, "precision": "highp " }, { "name": "cc_matViewProjInv", "typename": "mat4", "type": 25, "count": 1, "precision": "highp " }, { "name": "cc_cameraPos", "typename": "vec4", "type": 16, "count": 1, "precision": "highp " }, { "name": "cc_surfaceTransform", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_screenScale", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_exposure", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_mainLitDir", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_mainLitColor", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_ambientSky", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_ambientGround", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_fogColor", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_fogBase", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_fogAdd", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_nearFar", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " }, { "name": "cc_viewPort", "typename": "vec4", "type": 16, "count": 1, "precision": "mediump " } ], "defines": [], "stageFlags": 17 } ], "samplerTextures": [], "samplers": [], "textures": [], "buffers": [], "images": [], "subpassInputs": [] } ], "hash": 516018741, "glsl4": { "vert": "\nprecision mediump float;\nlayout(set = 2, binding = 0) uniform CCLocal {\n highp mat4 cc_matWorld;\n highp mat4 cc_matWorldIT;\n highp vec4 cc_lightingMapUVParam;\n highp vec4 cc_localShadowBias;\n highp vec4 cc_reflectionProbeData1;\n highp vec4 cc_reflectionProbeData2;\n highp vec4 cc_reflectionProbeBlendData1;\n highp vec4 cc_reflectionProbeBlendData2;\n};\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nlayout(location = 0) in highp vec3 a_position;\nlayout(location = 1) in vec3 a_normal;\nlayout(location = 0) out vec3 normal;\n#if USE_DASHED_LINE\n layout(location = 2) in float a_lineDistance;\n layout(location = 1) out float lineDistance;\n#endif\nvec4 vert () {\n normal = a_normal;\n vec4 pos = cc_matProj * (cc_matView * cc_matWorld) * vec4(a_position, 1);\n pos.z -= 0.000001;\n #if USE_DASHED_LINE\n lineDistance = a_lineDistance;\n #endif\n return pos;\n}\nvoid main() { gl_Position = vert(); }", "frag": "\nprecision mediump float;\nlayout(set = 0, binding = 0) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(set = 0, binding = 1) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nlayout(location = 0) in vec3 normal;\nlayout(location = 1) in float lineDistance;\nlayout(set = 1, binding = 0) uniform Constant {\n vec4 mainColor;\n vec4 selectedColor;\n vec4 selectedFaceForward;\n};\nvec4 front() {\n vec4 outputColor = mainColor;\n vec3 d = normal.xyz * selectedFaceForward.xyz;\n float m = max(max(d.x, d.y), d.z);\n float selected = step(0.9999,m);\n outputColor = selected==1. ? selectedColor : mainColor ;\n #if USE_FORWARD_PIPELINE\n return CCFragOutput(outputColor);\n #else\n #if USE_DASHED_LINE\n if (mod(lineDistance, 10.0) > 5.0) {\n discard;\n }\n #endif\n return outputColor;\n #endif\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = front(); }" }, "glsl3": { "vert": "\nprecision mediump float;\nlayout(std140) uniform CCLocal {\n highp mat4 cc_matWorld;\n highp mat4 cc_matWorldIT;\n highp vec4 cc_lightingMapUVParam;\n highp vec4 cc_localShadowBias;\n highp vec4 cc_reflectionProbeData1;\n highp vec4 cc_reflectionProbeData2;\n highp vec4 cc_reflectionProbeBlendData1;\n highp vec4 cc_reflectionProbeBlendData2;\n};\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nin highp vec3 a_position;\nin vec3 a_normal;\nout vec3 normal;\n#if USE_DASHED_LINE\n in float a_lineDistance;\n out float lineDistance;\n#endif\nvec4 vert () {\n normal = a_normal;\n vec4 pos = cc_matProj * (cc_matView * cc_matWorld) * vec4(a_position, 1);\n pos.z -= 0.000001;\n #if USE_DASHED_LINE\n lineDistance = a_lineDistance;\n #endif\n return pos;\n}\nvoid main() { gl_Position = vert(); }", "frag": "\nprecision mediump float;\nlayout(std140) uniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_nativeSize;\n mediump vec4 cc_probeInfo;\n mediump vec4 cc_debug_view_mode;\n};\nlayout(std140) uniform CCCamera {\n highp mat4 cc_matView;\n highp mat4 cc_matViewInv;\n highp mat4 cc_matProj;\n highp mat4 cc_matProjInv;\n highp mat4 cc_matViewProj;\n highp mat4 cc_matViewProjInv;\n highp vec4 cc_cameraPos;\n mediump vec4 cc_surfaceTransform;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_exposure;\n mediump vec4 cc_mainLitDir;\n mediump vec4 cc_mainLitColor;\n mediump vec4 cc_ambientSky;\n mediump vec4 cc_ambientGround;\n mediump vec4 cc_fogColor;\n mediump vec4 cc_fogBase;\n mediump vec4 cc_fogAdd;\n mediump vec4 cc_nearFar;\n mediump vec4 cc_viewPort;\n};\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nin vec3 normal;\nin float lineDistance;\nlayout(std140) uniform Constant {\n vec4 mainColor;\n vec4 selectedColor;\n vec4 selectedFaceForward;\n};\nvec4 front() {\n vec4 outputColor = mainColor;\n vec3 d = normal.xyz * selectedFaceForward.xyz;\n float m = max(max(d.x, d.y), d.z);\n float selected = step(0.9999,m);\n outputColor = selected==1. ? selectedColor : mainColor ;\n #if USE_FORWARD_PIPELINE\n return CCFragOutput(outputColor);\n #else\n #if USE_DASHED_LINE\n if (mod(lineDistance, 10.0) > 5.0) {\n discard;\n }\n #endif\n return outputColor;\n #endif\n}\nlayout(location = 0) out vec4 cc_FragColor;\nvoid main() { cc_FragColor = front(); }" }, "glsl1": { "vert": "\nprecision mediump float;\nuniform highp mat4 cc_matWorld;\nuniform highp mat4 cc_matView;\n uniform highp mat4 cc_matProj;\nattribute highp vec3 a_position;\nattribute vec3 a_normal;\nvarying vec3 normal;\n#if USE_DASHED_LINE\n attribute float a_lineDistance;\n varying float lineDistance;\n#endif\nvec4 vert () {\n normal = a_normal;\n vec4 pos = cc_matProj * (cc_matView * cc_matWorld) * vec4(a_position, 1);\n pos.z -= 0.000001;\n #if USE_DASHED_LINE\n lineDistance = a_lineDistance;\n #endif\n return pos;\n}\nvoid main() { gl_Position = vert(); }", "frag": "\nprecision mediump float;\nvec4 CCFragOutput (vec4 color) {\n return color;\n}\nvarying vec3 normal;\nvarying float lineDistance;\n uniform vec4 mainColor;\n uniform vec4 selectedColor;\n uniform vec4 selectedFaceForward;\nvec4 front() {\n vec4 outputColor = mainColor;\n vec3 d = normal.xyz * selectedFaceForward.xyz;\n float m = max(max(d.x, d.y), d.z);\n float selected = step(0.9999,m);\n outputColor = selected==1. ? selectedColor : mainColor ;\n #if USE_FORWARD_PIPELINE\n return CCFragOutput(outputColor);\n #else\n #if USE_DASHED_LINE\n if (mod(lineDistance, 10.0) > 5.0) {\n discard;\n }\n #endif\n return outputColor;\n #endif\n}\nvoid main() { gl_FragColor = front(); }" }, "builtins": { "globals": { "blocks": [ { "name": "CCGlobal", "defines": [] }, { "name": "CCCamera", "defines": [] } ], "samplerTextures": [], "buffers": [], "images": [] }, "locals": { "blocks": [ { "name": "CCLocal", "defines": [] } ], "samplerTextures": [], "buffers": [], "images": [] }, "statistics": { "CC_EFFECT_USED_VERTEX_UNIFORM_VECTORS": 56, "CC_EFFECT_USED_FRAGMENT_UNIFORM_VECTORS": 45 } }, "defines": [ { "name": "USE_DASHED_LINE", "type": "boolean", "defines": [] }, { "name": "USE_FORWARD_PIPELINE", "type": "boolean", "defines": [] } ], "name": "internal/editor/box-height-light|line-vs:vert|line-fs:front" } ], "combinations": [], "hideInEditor": true }