Class FragmentShader

Inheritance Relationships

Base Type

Class Documentation

class FragmentShader : public Shader

Represents a fragment shader, responsible for handling pixel-level processing in the rendering pipeline.

This class inherits from Shader and specifically loads, compiles, and manages a fragment shader from a given file path. Fragment shaders are executed for each pixel and are typically used to compute color and other attributes of each fragment.

Example usage:

FragmentShader fragmentShader("shaders/fragment.glsl");

See also

Shader

Public Functions

inline FragmentShader()

Constructs a FragmentShader object by loading and compiling a fragment shader from a file.

Parameters:

path – The file path to the fragment shader source code.

Throws:

std::runtime_error – If the shader file cannot be opened or compilation fails.