Allow for a clip plane with Surface

This commit is contained in:
Grant Sanderson
2023-01-13 21:42:34 -08:00
parent 1c1325ff8d
commit dae51abc17
4 changed files with 35 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class ShaderWrapper(object):
uniforms: dict[str, float] | None = None, # A dictionary mapping names of uniform variables
texture_paths: dict[str, str] | None = None, # A dictionary mapping names to filepaths for textures.
depth_test: bool = False,
use_clip_plane: bool = False,
render_primitive: int = moderngl.TRIANGLE_STRIP,
):
self.vert_data = vert_data
@ -44,6 +45,7 @@ class ShaderWrapper(object):
self.uniforms = uniforms or dict()
self.texture_paths = texture_paths or dict()
self.depth_test = depth_test
self.use_clip_plane = use_clip_plane
self.render_primitive = str(render_primitive)
self.init_program_code()
self.refresh_id()