Back

OglShadowShader

sofa::gl::component::shader::OglShadowShader
OglShader
Doc (from source)

This component sets the shader system responsible of the shadowing.

Abstract (AI generated)

The `OglShadowShader` sets up the shader system responsible for shadowing effects in graphical renderings within SOFA. It inherits from `OglShader`, enabling customization of lighting conditions and shadow quality.

Metadata
module
Sofa.GL.Component.Shader
namespace
sofa::gl::component::shader
include
sofa/gl/component/shader/OglShadowShader.h
inherits
  • OglShader
description

The OglShadowShader component in the SOFA framework is primarily responsible for setting up the shader system that handles shadowing effects within graphical renderings. This component is part of the visualization and rendering pipeline rather than the core mechanics or solver components, which are more concerned with mathematical models such as FEM equations and variational formulations. Therefore, it does not directly contribute to governing equations like mass matrix $M$, stiffness matrix $K$, internal forces $f_{int}$, residual $R$, or other constitutive laws that govern the mechanical behavior of deformable bodies.

The role of OglShadowShader is to enhance the visual realism and accuracy of rendered scenes by providing shadowing effects. It does not participate in the variational/Lagrangian mechanics framework, nor does it play a part in the assembly phase, time integration, nonlinear solve, linear solve, constraint handling, or mapping operations.

The component has two primary methods:
- init: A virtual method for initializing the shader.
- initShaders: Another virtual method that initializes shaders based on parameters such as numberOfLights and a boolean flag to enable or disable soft shadow effects (softShadow).

From a numerical perspective, the component does not encode any discretization choices related to finite element methods. Instead, it focuses on rendering techniques to improve visual fidelity.

In summary, the OglShadowShader is a visualization tool that provides enhanced realism through shadowing and has no mathematical or physical content in terms of FEM simulations.

Methods
void init () virtual
void initShaders (unsigned int numberOfLights, bool softShadow) virtual
{
  "name": "OglShadowShader",
  "namespace": "sofa::gl::component::shader",
  "module": "Sofa.GL.Component.Shader",
  "include": "sofa/gl/component/shader/OglShadowShader.h",
  "doc": "This component sets the shader system responsible of the shadowing.",
  "inherits": [
    "OglShader"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "init",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "initShaders",
      "return_type": "void",
      "params": [
        {
          "name": "numberOfLights",
          "type": "unsigned int"
        },
        {
          "name": "softShadow",
          "type": "bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `OglShadowShader` is a component within the SOFA framework, specifically in the `sofa::gl::component::shader` namespace under the module `Sofa.GL.Component.Shader`. This component is responsible for setting up the shader system that handles shadowing effects. It inherits from the `OglShader`, indicating it is designed to work with OpenGL shaders within SOFA's graphical rendering capabilities.\n\n**Interactions and API:**\n- **init**: A public virtual method used for initializing the shader.\n- **initShaders**: Another public virtual method that initializes shaders, taking parameters such as `numberOfLights` (an unsigned integer indicating the number of lights) and `softShadow` (a boolean flag to enable or disable soft shadow effects).\n\n**Practical Usage Guidance:**\nThis component is used when visualizing simulations where shadows are necessary for a more realistic rendering. The `initShaders` method allows customization based on lighting conditions and desired shadow quality, enabling users to fine-tune the visual output according to their needs.",
  "maths": "The `OglShadowShader` component in the SOFA framework is primarily responsible for setting up the shader system that handles shadowing effects within graphical renderings. This component is part of the visualization and rendering pipeline rather than the core mechanics or solver components, which are more concerned with mathematical models such as FEM equations and variational formulations. Therefore, it does not directly contribute to governing equations like mass matrix \\(M\\), stiffness matrix \\(K\\), internal forces \\(f_{int}\\), residual \\(R\\), or other constitutive laws that govern the mechanical behavior of deformable bodies.\n\nThe role of `OglShadowShader` is to enhance the visual realism and accuracy of rendered scenes by providing shadowing effects. It does not participate in the variational/Lagrangian mechanics framework, nor does it play a part in the assembly phase, time integration, nonlinear solve, linear solve, constraint handling, or mapping operations.\n\nThe component has two primary methods:\n- **init**: A virtual method for initializing the shader.\n- **initShaders**: Another virtual method that initializes shaders based on parameters such as `numberOfLights` and a boolean flag to enable or disable soft shadow effects (`softShadow`).\n\nFrom a numerical perspective, the component does not encode any discretization choices related to finite element methods. Instead, it focuses on rendering techniques to improve visual fidelity.\n\nIn summary, the `OglShadowShader` is a visualization tool that provides enhanced realism through shadowing and has no mathematical or physical content in terms of FEM simulations.",
  "abstract": "The `OglShadowShader` sets up the shader system responsible for shadowing effects in graphical renderings within SOFA. It inherits from `OglShader`, enabling customization of lighting conditions and shadow quality.",
  "sheet": "<p># OglShadowShader</p>\n\n<h2>Overview</h2>\n<p>The `OglShadowShader` is a component responsible for setting up the shader system that handles shadowing effects within graphical renderings in SOFA. It inherits from `OglShader`, indicating its role in OpenGL shaders and enabling customization of lighting conditions and shadow quality.</p>\n\n<h2>Practical Notes</h2>\n<p>This component is used when visualizing simulations where shadows are necessary for a more realistic rendering. The <code>initShaders</code> method allows customization based on the number of lights (`numberOfLights`) and whether to enable soft shadow effects (`softShadow`). This enables users to fine-tune the visual output according to their needs.</p>"
}