Vixen
02b45cc4
csharp
public static class EffectTranslator

Turns what Raven compiled into what the engine loads.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The only place in the repository where the compiler's vocabulary and the runtime's meet, and it exists so that they never have to anywhere else. The stages are spelled the same on both sides — Fragment, deliberately, so that this stays a widening from a plain enum to a flags one and never a translation. What genuinely differs is the rest: Raven describes a member of a struct array once with a stride and the engine wants a key per element; Raven's parameter names are bare and the engine's are qualified by shader. Every one of those is a rename, and every rename is somewhere a mistake could be made once and then be permanent in a bundle.

The naming has to match the generator, not merely resemble it. Vixen.Shaders.Generators emits ParameterKeys.New<float> ("Lighting.exposure") from the same reflection at build time; this produces the key a loaded effect writes through. They are interned by name, so agreeing means they are the same object and disagreeing means two keys for one offset — a value set through the generated one landing nowhere.

Methods (1)

Used by (1)

  • RavenEffectCompilerVixen.ShaderCompiler