yt.visualization.volume_rendering.shader_objects module

Shader and ShaderProgram wrapper classes for vertex and fragment shaders used in Interactive Data Visualization

class yt.visualization.volume_rendering.shader_objects.ApplyColormapFragmentShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.FragmentShader

A second pass fragment shader used to apply a colormap to the result of the first pass rendering

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'fragment'
class yt.visualization.volume_rendering.shader_objects.DefaultVertexShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.VertexShader

A first pass vertex shader that tranlates the location of vertices from the world coordinates to the viewing plane coordinates

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'vertex'
class yt.visualization.volume_rendering.shader_objects.FragmentShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.Shader

Wrapper class for fragment shaders

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'fragment'
class yt.visualization.volume_rendering.shader_objects.MaxIntensityFragmentShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.FragmentShader

A first pass fragment shader that computes Maximum Intensity Projection of the data. See Types of Projections for more information.

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'fragment'
class yt.visualization.volume_rendering.shader_objects.MeshFragmentShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.FragmentShader

A vertex shader used for unstructured mesh rendering.

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'fragment'
class yt.visualization.volume_rendering.shader_objects.MeshVertexShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.VertexShader

A vertex shader used for unstructured mesh rendering.

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'vertex'
class yt.visualization.volume_rendering.shader_objects.NoOpFragmentShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.FragmentShader

A second pass fragment shader that performs no operation. Usually used if the first pass already took care of applying proper color to the data

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'fragment'
class yt.visualization.volume_rendering.shader_objects.PassthroughFragmentShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.FragmentShader

A first pass fragment shader that performs no operation. Used for debug puproses. It’s distinct from NoOpFragmentShader, because of the number of uniforms

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'fragment'
class yt.visualization.volume_rendering.shader_objects.PassthroughVertexShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.VertexShader

A second pass vertex shader that performs no operations on vertices

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'vertex'
class yt.visualization.volume_rendering.shader_objects.ProjectionFragmentShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.FragmentShader

A first pass fragment shader that performs unweighted integration of the data along the line of sight. See Types of Projections for more information.

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'fragment'
class yt.visualization.volume_rendering.shader_objects.RegisteredShader(name, b, d)[source]

Bases: type

mro() → list

return a type’s method resolution order

class yt.visualization.volume_rendering.shader_objects.Shader(source=None)[source]

Bases: object

Creates a shader from source

Parameters:source (str) – This can either be a string containing a full source of a shader, an absolute path to a source file or a filename of a shader residing in the ./shaders/ directory.
compile(source=None, parameters=None)[source]
delete_shader()[source]
shader
class yt.visualization.volume_rendering.shader_objects.ShaderProgram(vertex_shader=None, fragment_shader=None)[source]

Bases: object

Wrapper class that compiles and links vertex and fragment shaders into a shader program.

Parameters:
bind_vert_attrib(name, bind_loc, size)[source]
delete_program()[source]
disable_vert_attrib(name)[source]
enable()[source]
class yt.visualization.volume_rendering.shader_objects.TransferFunctionFragmentShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.FragmentShader

A first pass fragment shader that performs ray casting using transfer function. See Volume Rendering Method for more details.

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'fragment'
class yt.visualization.volume_rendering.shader_objects.VertexShader(source=None)[source]

Bases: yt.visualization.volume_rendering.shader_objects.Shader

Wrapper class for vertex shaders

compile(source=None, parameters=None)
delete_shader()
shader
shader_type = 'vertex'