Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

4.3 KB
Raw Blame
// Generated by tools/gen.sh from Blender's own API (tools/dump.py). Don't edit: regenerate.
import type * as H from "../../types";
import type * as M from "../../mathutils";
import type * as R from "../rna";
import type * as E from "../enums";
import type * as P from "../py";

/**
 * This module provides access to GPUShader internal functions.
 *
 * .. _built-in-shaders:
 *
 * .. rubric:: Built-in shaders
 *
 * All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.
 *
 * Its value must be modified using the :mod:`gpu.matrix` module.
 *
 * .. important::
 *
 *    Shader uniforms must be explicitly initialized to avoid retaining values from previous executions.
 *
 * ``FLAT_COLOR``
 *    :Attributes: vec3 pos, vec4 color
 *    :Uniforms: none
 * ``IMAGE``
 *    :Attributes: vec3 pos, vec2 texCoord
 *    :Uniforms: sampler2D image
 * ``IMAGE_SCENE_LINEAR_TO_REC709_SRGB``
 *    :Attributes: vec3 pos, vec2 texCoord
 *    :Uniforms: sampler2D image
 *    :Note: Expect texture to be in scene linear color space
 * ``IMAGE_COLOR``
 *    :Attributes: vec3 pos, vec2 texCoord
 *    :Uniforms: sampler2D image, vec4 color
 * ``IMAGE_COLOR_SCENE_LINEAR_TO_REC709_SRGB``
 *    :Attributes: vec3 pos, vec2 texCoord
 *    :Uniforms: sampler2D image, vec4 color
 *    :Note: Expect texture to be in scene linear color space
 * ``SMOOTH_COLOR``
 *    :Attributes: vec3 pos, vec4 color
 *    :Uniforms: none
 * ``UNIFORM_COLOR``
 *    :Attributes: vec3 pos
 *    :Uniforms: vec4 color
 * ``POLYLINE_FLAT_COLOR``
 *    :Attributes: vec3 pos, vec4 color
 *    :Uniforms: vec2 viewportSize, float lineWidth
 * ``POLYLINE_SMOOTH_COLOR``
 *    :Attributes: vec3 pos, vec4 color
 *    :Uniforms: vec2 viewportSize, float lineWidth
 * ``POLYLINE_UNIFORM_COLOR``
 *    :Attributes: vec3 pos
 *    :Uniforms: vec2 viewportSize, float lineWidth, vec4 color
 * ``POINT_FLAT_COLOR``
 *    :Attributes: vec3 pos, vec4 color
 *    :Uniforms: float size
 * ``POINT_UNIFORM_COLOR``
 *    :Attributes: vec3 pos
 *    :Uniforms: vec4 color, float size
 */
export interface Api {
  /**
   * Create shader from a GPUShaderCreateInfo.
   * @returns Shader object corresponding to the given shader info.
   * @param shader_info GPUShaderCreateInfo
   */
  create_from_info(shader_info: P.gpu_types.GPUShaderCreateInfo): H.Ptr<P.gpu_types.GPUShader>;
  /**
   * Create shader from a GPUShaderCreateInfo.
   * @returns Shader object corresponding to the given shader info.
   * @param shader_info GPUShaderCreateInfo
   */
  create_from_info(kw: {
    /** GPUShaderCreateInfo */
    shader_info: P.gpu_types.GPUShaderCreateInfo;
  }): H.Ptr<P.gpu_types.GPUShader>;
  /**
   * Shaders that are embedded in the Blender internal code (see :ref:`built-in-shaders`).
   * They all read the uniform ``mat4 ModelViewProjectionMatrix``,
   * which can be edited by the :mod:`gpu.matrix` module.
   *
   * You can also choose a shader configuration that uses clip_planes by setting the ``CLIPPED`` value to the config parameter. Note that in this case you also need to manually set the value of ``mat4 ModelMatrix``.
   * @returns Shader object corresponding to the given name.
   * @param shader_name One of the builtin shader names.
   */
  from_builtin(shader_name: H.In<string>, kw?: {
    /**
     * One of these types of shader configuration:
     * - ``DEFAULT``
     * - ``CLIPPED``
     */
    config?: H.In<string>;
  }): H.Ptr<P.gpu_types.GPUShader>;
  /**
   * Shaders that are embedded in the Blender internal code (see :ref:`built-in-shaders`).
   * They all read the uniform ``mat4 ModelViewProjectionMatrix``,
   * which can be edited by the :mod:`gpu.matrix` module.
   *
   * You can also choose a shader configuration that uses clip_planes by setting the ``CLIPPED`` value to the config parameter. Note that in this case you also need to manually set the value of ``mat4 ModelMatrix``.
   * @returns Shader object corresponding to the given name.
   * @param shader_name One of the builtin shader names.
   */
  from_builtin(kw: {
    /** One of the builtin shader names. */
    shader_name: H.In<string>;
    /**
     * One of these types of shader configuration:
     * - ``DEFAULT``
     * - ``CLIPPED``
     */
    config?: H.In<string>;
  }): H.Ptr<P.gpu_types.GPUShader>;
  /** Unbind the bound shader object. */
  unbind(...args: any[]): H.Ref<void>;
}