Skip to content

Updating the "List of GLSL Inputs" to include inputs from the Cg listing #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 1.10
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions programming/shaders/list-of-glsl-inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,52 @@ any shader stage.
float scale; // 1.0 / (end - start)
} p3d_Fog;

// In addition to the above matrices, it is possible to request arbitrary matrices
// (or parts of matrices), either of the current model, or of an aribtrary node.
// In the latter case, the node should be supplied the shader via a call to :meth:`~.NodePath.set_shader_input()`.

// A matrix that transforms from coordinate system X to coordinate system Y. See
// the section on :ref:`shaders-and-coordinate-spaces` for more information.
uniform mat4 trans_x_to_y;
// Transpose of trans_x_to_y
uniform mat4 tpose_x_to_y;

// Row 0 of trans_x_to_y.
uniform vec4 row0_x_to_y;
// Row 1 of trans_x_to_y.
uniform vec4 row1_x_to_y;
// Row 2 of trans_x_to_y.
uniform vec4 row2_x_to_y;
// Row 3 of trans_x_to_y.
uniform vec4 row3_x_to_y;

// Col 0 of trans_x_to_y.
uniform vec4 col0_x_to_y;
// Col 1 of trans_x_to_y.
uniform vec4 col1_x_to_y;
// Col 2 of trans_x_to_y.
uniform vec4 col2_x_to_y;
// Col 3 of trans_x_to_y.
uniform vec4 col3_x_to_y;

// Model-Space Transform of X, aka trans_x_to_model
uniform mat4 mstrans_x;
// Clip-Space Transform of X, aka trans_x_to_clip
uniform mat4 cstrans_x;
// World-Space Transform of X, aka trans_x_to_world
uniform mat4 wstrans_x;
// View-Space Transform of X, aka trans_x_to_view
uniform mat4 vstrans_x;

// Model-Space Position of X, aka row3_x_to_model
uniform vec4 mspos_x;
// Clip-Space Position of X, aka row3_x_to_clip
uniform vec4 cspos_x;
// World-Space Position of X, aka row3_x_to_world
uniform vec4 wspos_x;
// View-Space Position of X, aka row3_x_to_view
uniform float4 vspos_x;

Besides these predefined uniform inputs, it is possible to use most of the types
available in GLSL in conjunction with :meth:`~.NodePath.set_shader_input()` to
pass custom data, including arrays and structs, to a certain named shader input.
Expand Down