mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Rename shader_dtype -> data_dtype
This commit is contained in:
parent
09bed1f8f4
commit
c8d5e91422
6 changed files with 9 additions and 9 deletions
|
@ -69,7 +69,7 @@ class Mobject(object):
|
||||||
shader_folder: str = ""
|
shader_folder: str = ""
|
||||||
render_primitive: int = moderngl.TRIANGLE_STRIP
|
render_primitive: int = moderngl.TRIANGLE_STRIP
|
||||||
# Must match in attributes of vert shader
|
# Must match in attributes of vert shader
|
||||||
shader_dtype: np.dtype = np.dtype([
|
data_dtype: np.dtype = np.dtype([
|
||||||
('point', np.float32, (3,)),
|
('point', np.float32, (3,)),
|
||||||
('rgba', np.float32, (4,)),
|
('rgba', np.float32, (4,)),
|
||||||
])
|
])
|
||||||
|
@ -133,7 +133,7 @@ class Mobject(object):
|
||||||
return self.replicate(other)
|
return self.replicate(other)
|
||||||
|
|
||||||
def init_data(self, length: int = 0):
|
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)
|
self._data_defaults = np.ones(1, dtype=self.data.dtype)
|
||||||
|
|
||||||
def init_uniforms(self):
|
def init_uniforms(self):
|
||||||
|
|
|
@ -26,7 +26,7 @@ DEFAULT_BUFF_RATIO = 0.5
|
||||||
class DotCloud(PMobject):
|
class DotCloud(PMobject):
|
||||||
shader_folder: str = "true_dot"
|
shader_folder: str = "true_dot"
|
||||||
render_primitive: int = moderngl.POINTS
|
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,)),
|
('point', np.float32, (3,)),
|
||||||
('radius', np.float32, (1,)),
|
('radius', np.float32, (1,)),
|
||||||
('rgba', np.float32, (4,)),
|
('rgba', np.float32, (4,)),
|
||||||
|
|
|
@ -19,7 +19,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
class ImageMobject(Mobject):
|
class ImageMobject(Mobject):
|
||||||
shader_folder: str = "image"
|
shader_folder: str = "image"
|
||||||
shader_dtype: Sequence[Tuple[str, type, Tuple[int]]] = [
|
data_dtype: Sequence[Tuple[str, type, Tuple[int]]] = [
|
||||||
('point', np.float32, (3,)),
|
('point', np.float32, (3,)),
|
||||||
('im_coords', np.float32, (2,)),
|
('im_coords', np.float32, (2,)),
|
||||||
('opacity', np.float32, (1,)),
|
('opacity', np.float32, (1,)),
|
||||||
|
|
|
@ -26,7 +26,7 @@ if TYPE_CHECKING:
|
||||||
class Surface(Mobject):
|
class Surface(Mobject):
|
||||||
render_primitive: int = moderngl.TRIANGLES
|
render_primitive: int = moderngl.TRIANGLES
|
||||||
shader_folder: str = "surface"
|
shader_folder: str = "surface"
|
||||||
shader_dtype: np.dtype = np.dtype([
|
data_dtype: np.dtype = np.dtype([
|
||||||
('point', np.float32, (3,)),
|
('point', np.float32, (3,)),
|
||||||
('normal', np.float32, (3,)),
|
('normal', np.float32, (3,)),
|
||||||
('rgba', np.float32, (4,)),
|
('rgba', np.float32, (4,)),
|
||||||
|
@ -289,7 +289,7 @@ class SGroup(Surface):
|
||||||
|
|
||||||
class TexturedSurface(Surface):
|
class TexturedSurface(Surface):
|
||||||
shader_folder: str = "textured_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,)),
|
('point', np.float32, (3,)),
|
||||||
('normal', np.float32, (3,)),
|
('normal', np.float32, (3,)),
|
||||||
('im_coords', np.float32, (2,)),
|
('im_coords', np.float32, (2,)),
|
||||||
|
|
|
@ -65,7 +65,7 @@ DEFAULT_FILL_COLOR = GREY_C
|
||||||
|
|
||||||
|
|
||||||
class VMobject(Mobject):
|
class VMobject(Mobject):
|
||||||
shader_dtype: np.dtype = np.dtype([
|
data_dtype: np.dtype = np.dtype([
|
||||||
('point', np.float32, (3,)),
|
('point', np.float32, (3,)),
|
||||||
('stroke_rgba', np.float32, (4,)),
|
('stroke_rgba', np.float32, (4,)),
|
||||||
('stroke_width', np.float32, (1,)),
|
('stroke_width', np.float32, (1,)),
|
||||||
|
|
|
@ -264,7 +264,7 @@ class SceneFileWriter(object):
|
||||||
width, height = self.scene.camera.get_pixel_shape()
|
width, height = self.scene.camera.get_pixel_shape()
|
||||||
|
|
||||||
vf_arg = 'vflip'
|
vf_arg = 'vflip'
|
||||||
if self.pixel_format.startswith("yuv"):
|
# if self.pixel_format.startswith("yuv"):
|
||||||
vf_arg += f',eq=saturation={self.saturation}:gamma={self.gamma}'
|
vf_arg += f',eq=saturation={self.saturation}:gamma={self.gamma}'
|
||||||
|
|
||||||
command = [
|
command = [
|
||||||
|
|
Loading…
Add table
Reference in a new issue