9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
5.7 KiB
5.7 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-webgl-api | WebGL API | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
WebGL API
매 한 줄
"매 OpenGL ES 의 web — canvas 의 GPU draw". WebGL 매 OpenGL ES 2.0 (WebGL1) / ES 3.0 (WebGL2) binding 의 browser. 2026 매 WebGPU rising 매 WebGL 매 still ubiquitous — fallback / wide compatibility 의 사용.
매 핵심
매 pipeline
- Vertex shader: per-vertex transform — clip space.
- Rasterizer: triangles → fragments.
- Fragment shader: per-pixel color.
- Framebuffer: render target — default canvas / FBO offscreen.
매 핵심 objects
- Buffer (
ARRAY_BUFFER,ELEMENT_ARRAY_BUFFER): vertex / index data. - Texture (2D / cube / 3D-WebGL2 / array-WebGL2).
- Program: vertex + fragment shader linked.
- VAO (WebGL2): vertex attribute state.
- UBO (WebGL2): uniform block — efficient bulk uniform.
- Framebuffer / Renderbuffer: offscreen render targets.
매 응용
- 3D libraries: Three.js / Babylon.js / PlayCanvas.
- 2D accelerated: PixiJS / Konva.
- Data viz: deck.gl / Mapbox GL / regl.
- Games / interactive: itch.io HTML5 / Unity WebGL build.
💻 패턴
매 minimal triangle
const canvas = document.querySelector('canvas');
const gl = canvas.getContext('webgl2');
const vs = `#version 300 es
in vec2 a_pos;
void main() { gl_Position = vec4(a_pos, 0.0, 1.0); }`;
const fs = `#version 300 es
precision highp float;
out vec4 fragColor;
void main() { fragColor = vec4(1.0, 0.5, 0.2, 1.0); }`;
function compile(type, src) {
const s = gl.createShader(type);
gl.shaderSource(s, src); gl.compileShader(s);
if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) throw gl.getShaderInfoLog(s);
return s;
}
const prog = gl.createProgram();
gl.attachShader(prog, compile(gl.VERTEX_SHADER, vs));
gl.attachShader(prog, compile(gl.FRAGMENT_SHADER, fs));
gl.linkProgram(prog);
const vao = gl.createVertexArray();
gl.bindVertexArray(vao);
const vbo = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0, 0.5, -0.5, -0.5, 0.5, -0.5]), gl.STATIC_DRAW);
const loc = gl.getAttribLocation(prog, 'a_pos');
gl.enableVertexAttribArray(loc);
gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);
gl.useProgram(prog);
gl.drawArrays(gl.TRIANGLES, 0, 3);
Texture upload
const tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA8, w, h, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.generateMipmap(gl.TEXTURE_2D);
Instanced rendering (WebGL2)
gl.vertexAttribDivisor(instanceLoc, 1); // advance per instance
gl.drawArraysInstanced(gl.TRIANGLES, 0, 6, 10000); // 10k instances 1 draw call
Uniform Buffer Object (WebGL2)
const ubo = gl.createBuffer();
gl.bindBuffer(gl.UNIFORM_BUFFER, ubo);
gl.bufferData(gl.UNIFORM_BUFFER, mat4Buffer, gl.DYNAMIC_DRAW);
const idx = gl.getUniformBlockIndex(prog, 'Camera');
gl.uniformBlockBinding(prog, idx, 0);
gl.bindBufferBase(gl.UNIFORM_BUFFER, 0, ubo);
Framebuffer (offscreen / render-to-texture)
const fbo = gl.createFramebuffer();
gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
const tex = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, tex);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA16F, w, h, 0, gl.RGBA, gl.HALF_FLOAT, null);
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
// 매 render → tex, then post-process
Transform Feedback (WebGL2 GPU compute-ish)
gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, 0, outBuf);
gl.beginTransformFeedback(gl.POINTS);
gl.drawArrays(gl.POINTS, 0, particleCount);
gl.endTransformFeedback();
Context loss handling
canvas.addEventListener('webglcontextlost', (e) => { e.preventDefault(); });
canvas.addEventListener('webglcontextrestored', () => { rebuildResources(); });
매 결정 기준
| 상황 | WebGL vs WebGPU |
|---|---|
| 2026 wide compatibility | WebGL2 — Safari iOS / older Android |
| Compute shader | WebGPU |
| Multi-pass complex | WebGPU 매 cleaner state model |
| Existing Three.js / Babylon | WebGL2 fallback + WebGPU primary |
| Simple 2D accel | WebGL2 / 2D canvas |
| AAA-grade graphics | WebGPU |
기본값: Three.js with WebGPURenderer + WebGL2 fallback.
🔗 Graph
🤖 LLM 활용
언제: cross-browser 3D / 2D GPU accel / data viz / WebGPU 의 fallback. 언제 X: heavy compute (no compute shader in WebGL) / cutting-edge graphics — WebGPU 사용.
❌ 안티패턴
- State thrash: bind/unbind every draw — batch by program/texture.
- Sync readback:
readPixels매 GPU stall — use PBO async (WebGL2). - No VAO: re-binding attributes every draw — VAO 매 cache.
- Uniform per draw call: UBO 의 bulk update / instancing.
- Premultiply confusion: alpha blending 의 incorrect —
UNPACK_PREMULTIPLY_ALPHA_WEBGL.
🧪 검증 / 중복
- Verified (Khronos WebGL 1.0/2.0 spec / MDN WebGL API).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — pipeline, VAO, UBO, FBO, instancing, transform feedback |