Hi Paradox Team,
I’ve been attempting to unravel the material and effect system and would greatly appreciate a quick sanity check of my current understanding. Let’s say I set glossiness to a scalar in the editor. I believe the editor must be using the IMaterialFeature ‘nodes’ to generate the mixins [based on metadata in the material descriptors]. Assuming yes, does the shader code below roughly mimic what
SiliconStudio.Paradox.Rendering.Materials.MaterialGlossinessMapFeature.Visit(MaterialGeneratorContext context)
does when compiling a trivial scalar glossiness effect?
// var computeColorSource = GlossinessMap.GenerateShaderSource(context, new MaterialComputeColorKeys(MaterialKeys.GlossinessMap, MaterialKeys.GlossinessValue));
class MyComputeColor : ComputeColor
{
override float4 Compute()
{
return 0.1;
}
};
shader MyEffect
{
// var mixin = new ShaderMixinSource();
// mixin.Mixins.Add(new ShaderClassSource("MaterialSurfaceGlossinessMap", Invert));
// mixin.AddComposition("glossinessMap", computeColorSource);
// context.AddSurfaceShader(MaterialShaderStage.Pixel, mixin);
mixin MaterialSurfaceGlossinessMap;
mixin compose glossinessMap = MyComputeColor;
// ...
}