尝试 gl backend

This commit is contained in:
bk_office
2026-04-25 14:31:23 +08:00
parent 81e0c05686
commit cc97ca5493
10 changed files with 291 additions and 15 deletions

View File

@ -18,8 +18,8 @@ from dataclasses import dataclass
import re
import numpy as np
from dataclasses import dataclass
from konabot.plugins.marchtoy.obj import Object, Camera, OBJECT_ENTRIES
from konabot.plugins.marchtoy.op import OPERATION_ENTRIES
from obj import Object, Camera, OBJECT_ENTRIES
from op import OPERATION_ENTRIES
from typing import Optional
@dataclass
@ -113,8 +113,8 @@ class Scene:
def __str__(self) -> str:
return ", ".join([str(type(obj)) for obj in self.canvas_objs])
def compile(self) -> str:
PATH = pathlib.Path(__file__).parent / "shaders" / "raymarch.sksl"
def compile(self, fs_src: str = "frag.glsl") -> str:
PATH = pathlib.Path(__file__).parent / "shaders" / fs_src
with PATH.open(encoding="utf-8") as f:
content = f.read()
sdf_block: str = ""