Table of Contents

Class RaylibShader

Namespace
ShadowDusk.Compiler.Raylib
Assembly
ShadowDusk.Compiler.dll

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

FragmentShader string

#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.

Uniforms IReadOnlyList<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).

Samplers IReadOnlyList<RaylibSampler>

Every sampler the shader declares (see RaylibSampler).

Warnings IReadOnlyList<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

string

Samplers

Every sampler the shader declares (see RaylibSampler).

public IReadOnlyList<RaylibSampler> Samplers { get; init; }

Property Value

IReadOnlyList<RaylibSampler>

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

IReadOnlyList<RaylibUniform>

Warnings

Non-fatal findings, e.g. baked sampler states the consumer must apply (SD0637).

public IReadOnlyList<ShaderError> Warnings { get; init; }

Property Value

IReadOnlyList<ShaderError>