:right-sidebar: True GLShaderNode =================================================================== .. currentmodule:: gi.repository.Gsk .. class:: GLShaderNode(*args, **kwargs) :no-contents-entry: Superclasses: :class:`~gi.repository.Gsk.RenderNode` :Constructors: :: GLShaderNode(**properties) new(shader:Gsk.GLShader, bounds:Graphene.Rect, args:GLib.Bytes, children:list=None) -> Gsk.GLShaderNode Constructors ------------ .. rst-class:: interim-class .. class:: GLShaderNode :no-index: .. classmethod:: new(shader: ~gi.repository.Gsk.GLShader, bounds: ~gi.repository.Graphene.Rect, args: ~gi.repository.GLib.Bytes, children: ~typing.Sequence[~gi.repository.Gsk.RenderNode] | None = None) -> ~gi.repository.Gsk.GLShaderNode Creates a ``GskRenderNode`` that will render the given ``shader`` into the area given by ``bounds``. The ``args`` is a block of data to use for uniform input, as per types and offsets defined by the ``shader``. Normally this is generated by :obj:`~gi.repository.Gsk.GLShader.format_args` or :obj:`~gi.repository.Gsk.ShaderArgsBuilder`. See :obj:`~gi.repository.Gsk.GLShader` for details about how the shader should be written. All the children will be rendered into textures (if they aren't already ``GskTextureNodes``, which will be used directly). These textures will be sent as input to the shader. If the renderer doesn't support GL shaders, or if there is any problem when compiling the shader, then the node will draw pink. You should use :obj:`~gi.repository.Gsk.GLShader.compile` to ensure the ``shader`` will work for the renderer before using it. :param shader: the ``GskGLShader`` :param bounds: the rectangle to render the shader into :param args: Arguments for the uniforms :param children: array of child nodes, these will be rendered to textures and used as input. Methods ------- .. rst-class:: interim-class .. class:: GLShaderNode :no-index: .. method:: get_args() -> ~gi.repository.GLib.Bytes Gets args for the node. .. method:: get_child(idx: int) -> ~gi.repository.Gsk.RenderNode Gets one of the children. :param idx: the position of the child to get .. method:: get_n_children() -> int Returns the number of children .. method:: get_shader() -> ~gi.repository.Gsk.GLShader Gets shader code for the node.