Class RaylibShader
The successful product: a raylib fragment shader plus the binding contract the consumer's
draw code needs. Deliberately NOT a CompiledShader: that type's
Data is an effect container every existing consumer hands to new Effect(...),
and a GLSL string in that slot would load as garbage instead of failing.
public sealed record RaylibShader : IEquatable<RaylibShader>
- Inheritance
-
RaylibShader
- Implements
- Inherited Members
Constructors
RaylibShader(string, IReadOnlyList<RaylibUniform>, IReadOnlyList<RaylibSampler>, IReadOnlyList<ShaderError>)
The successful product: a raylib fragment shader plus the binding contract the consumer's
draw code needs. Deliberately NOT a CompiledShader: that type's
Data is an effect container every existing consumer hands to new Effect(...),
and a GLSL string in that slot would load as garbage instead of failing.
public RaylibShader(string FragmentShader, IReadOnlyList<RaylibUniform> Uniforms, IReadOnlyList<RaylibSampler> Samplers, IReadOnlyList<ShaderError> Warnings)
Parameters
FragmentShaderstring#version 330GLSL (raylib'sglsl330profile) forRaylib.LoadShaderFromMemory(null, FragmentShader). Thenullvertex shader is the point: raylib's built-in vertex shader suppliesfragTexCoordandfragColor, which is the only interface this slice emits against.UniformsIReadOnlyList<RaylibUniform>Every uniform the shader declares, under the GLSL name to pass to
GetShaderLocation. Each is the HLSL global of the same name, with the default its HLSL declaration gives it (DefaultValue).SamplersIReadOnlyList<RaylibSampler>Every sampler the shader declares (see RaylibSampler).
WarningsIReadOnlyList<ShaderError>Non-fatal findings, e.g. baked sampler states the consumer must apply (
SD0637).
Properties
FragmentShader
#version 330 GLSL (raylib's glsl330 profile) for
Raylib.LoadShaderFromMemory(null, FragmentShader). The null vertex shader is
the point: raylib's built-in vertex shader supplies fragTexCoord and
fragColor, which is the only interface this slice emits against.
public string FragmentShader { get; init; }
Property Value
Samplers
Every sampler the shader declares (see RaylibSampler).
public IReadOnlyList<RaylibSampler> Samplers { get; init; }
Property Value
Uniforms
Every uniform the shader declares, under the GLSL name to pass to
GetShaderLocation. Each is the HLSL global of the same name, with the default its HLSL
declaration gives it (DefaultValue).
public IReadOnlyList<RaylibUniform> Uniforms { get; init; }
Property Value
Warnings
Non-fatal findings, e.g. baked sampler states the consumer must apply (SD0637).
public IReadOnlyList<ShaderError> Warnings { get; init; }