refactor: 着色器元素

This commit is contained in:
unanmed 2024-10-09 22:37:18 +08:00
parent 4b8cb729e2
commit 151dcbc3fd
3 changed files with 751 additions and 252 deletions

View File

@ -639,7 +639,7 @@ export class Shadow {
const lightsBuffer = Shadow.buffer.color.lights; const lightsBuffer = Shadow.buffer.color.lights;
gl.bindBuffer(gl.UNIFORM_BUFFER, lightsBuffer); gl.bindBuffer(gl.UNIFORM_BUFFER, lightsBuffer);
gl.bufferData(gl.UNIFORM_BUFFER, new Float32Array(data), gl.STATIC_DRAW); gl.bufferData(gl.UNIFORM_BUFFER, new Float32Array(data), gl.DYNAMIC_DRAW);
gl.uniformBlockBinding(Shadow.program.color, blockIndex, 0); gl.uniformBlockBinding(Shadow.program.color, blockIndex, 0);
gl.bindBufferBase(gl.UNIFORM_BUFFER, 0, lightsBuffer); gl.bindBufferBase(gl.UNIFORM_BUFFER, 0, lightsBuffer);

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,8 @@
"14": "Animate extension needs 'floor-hero' extension as dependency.", "14": "Animate extension needs 'floor-hero' extension as dependency.",
"15": "Viewport extension needs 'floor-hero' extension as dependency.", "15": "Viewport extension needs 'floor-hero' extension as dependency.",
"16": "Cannot find log message for $1 code $2.", "16": "Cannot find log message for $1 code $2.",
"17": "Cannot use shader program for shader element that does not belong to it.",
"18": "Cannot delete shader program for shader element that does not belong to it.",
"1101": "Shadow extension needs 'floor-hero' extension as dependency.", "1101": "Shadow extension needs 'floor-hero' extension as dependency.",
"1201": "Floor-damage extension needs 'floor-binder' extension as dependency.", "1201": "Floor-damage extension needs 'floor-binder' extension as dependency.",
"1301": "Portal extension need 'floor-binder' extension as dependency.", "1301": "Portal extension need 'floor-binder' extension as dependency.",
@ -41,10 +43,11 @@
"17": "Floor-damage extension needs 'floor-binder' extension as dependency.", "17": "Floor-damage extension needs 'floor-binder' extension as dependency.",
"18": "Uncaught error in posting like info for danmaku. Danmaku id: $1.", "18": "Uncaught error in posting like info for danmaku. Danmaku id: $1.",
"19": "Repeat light id: '$1'.", "19": "Repeat light id: '$1'.",
"20": "Cannot apply animation to camera operation that is not belong to it.", "20": "Cannot apply animation to camera operation that does not belong to it.",
"21": "Cannot apply transition to camera operation that is not belong to it.", "21": "Cannot apply transition to camera operation that does not belong to it.",
"22": "There is already an active camera for delivered render item. Consider using 'Camera.for' or diable the active camera to avoid some exceptions.", "22": "There is already an active camera for delivered render item. Consider using 'Camera.for' or diable the active camera to avoid some exceptions.",
"23": "Render item with id of '$1' has already exists.", "23": "Render item with id of '$1' has already exists.",
"24": "Uniform block can only be used in glsl version es 300.",
"1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency." "1001": "Item-detail extension needs 'floor-binder' and 'floor-damage' extension as dependency."
} }
} }