Rename shader_dtype -> data_dtype

This commit is contained in:
Grant Sanderson 2024-08-22 14:52:35 -05:00
parent 09bed1f8f4
commit c8d5e91422
6 changed files with 9 additions and 9 deletions

View file

@ -69,7 +69,7 @@ class Mobject(object):
shader_folder: str = ""
render_primitive: int = moderngl.TRIANGLE_STRIP
# Must match in attributes of vert shader
shader_dtype: np.dtype = np.dtype([
data_dtype: np.dtype = np.dtype([
('point', np.float32, (3,)),
('rgba', np.float32, (4,)),
])
@ -133,7 +133,7 @@ class Mobject(object):
return self.replicate(other)
def init_data(self, length: int = 0):
self.data = np.zeros(length, dtype=self.shader_dtype)
self.data = np.zeros(length, dtype=self.data_dtype)
self._data_defaults = np.ones(1, dtype=self.data.dtype)
def init_uniforms(self):

View file

@ -26,7 +26,7 @@ DEFAULT_BUFF_RATIO = 0.5
class DotCloud(PMobject):
shader_folder: str = "true_dot"
render_primitive: int = moderngl.POINTS
shader_dtype: Sequence[Tuple[str, type, Tuple[int]]] = [
data_dtype: Sequence[Tuple[str, type, Tuple[int]]] = [
('point', np.float32, (3,)),
('radius', np.float32, (1,)),
('rgba', np.float32, (4,)),

View file

@ -19,7 +19,7 @@ if TYPE_CHECKING:
class ImageMobject(Mobject):
shader_folder: str = "image"
shader_dtype: Sequence[Tuple[str, type, Tuple[int]]] = [
data_dtype: Sequence[Tuple[str, type, Tuple[int]]] = [
('point', np.float32, (3,)),
('im_coords', np.float32, (2,)),
('opacity', np.float32, (1,)),

View file

@ -26,7 +26,7 @@ if TYPE_CHECKING:
class Surface(Mobject):
render_primitive: int = moderngl.TRIANGLES
shader_folder: str = "surface"
shader_dtype: np.dtype = np.dtype([
data_dtype: np.dtype = np.dtype([
('point', np.float32, (3,)),
('normal', np.float32, (3,)),
('rgba', np.float32, (4,)),
@ -289,7 +289,7 @@ class SGroup(Surface):
class TexturedSurface(Surface):
shader_folder: str = "textured_surface"
shader_dtype: Sequence[Tuple[str, type, Tuple[int]]] = [
data_dtype: Sequence[Tuple[str, type, Tuple[int]]] = [
('point', np.float32, (3,)),
('normal', np.float32, (3,)),
('im_coords', np.float32, (2,)),

View file

@ -65,7 +65,7 @@ DEFAULT_FILL_COLOR = GREY_C
class VMobject(Mobject):
shader_dtype: np.dtype = np.dtype([
data_dtype: np.dtype = np.dtype([
('point', np.float32, (3,)),
('stroke_rgba', np.float32, (4,)),
('stroke_width', np.float32, (1,)),

View file

@ -264,8 +264,8 @@ class SceneFileWriter(object):
width, height = self.scene.camera.get_pixel_shape()
vf_arg = 'vflip'
if self.pixel_format.startswith("yuv"):
vf_arg += f',eq=saturation={self.saturation}:gamma={self.gamma}'
# if self.pixel_format.startswith("yuv"):
vf_arg += f',eq=saturation={self.saturation}:gamma={self.gamma}'
command = [
FFMPEG_BIN,