11using System . Collections . ObjectModel ;
2- using GAIL . Core ;
3- using OxDED . Terminal . Assertion ;
42
53namespace GAIL . Graphics . Material ;
64
@@ -18,25 +16,24 @@ public interface IMaterial {
1816/// Contains information about how anything is drawn to the window, contains the shader and shader data.
1917/// </summary>
2018public abstract class Material : IMaterial {
21- // private static IShader CreateShader(GraphicsManager manager, byte[] vertexShader, byte[]? fragmentShader = null, byte[]? geometryShader = null) {
22- // IShader shader = Assert.IsNotNull(manager.CreateShader(vertexShader, fragmentShader, geometryShader)).OnFailure((Assertion _) => {
23- // manager.Logger.LogError("Failed to create shader.");
24- // throw new InvalidOperationException("Failed to create shader.");
25- // }).As<ReferenceAssertion<IShader?>>()!.Asserter().value!;
26- // return shader;
19+ // private static IShader CreateShader(GraphicsManager manager, ) {
20+ //
2721 // }
2822
23+ public readonly IShader Shader ;
24+
25+ /// <inheritdoc/>
26+ public virtual ReadOnlyCollection < AttributeType > RequiredUniforms => Shader . RequiredUniforms ;
27+
2928 /// <summary>
3029 /// Creates a new material.
3130 /// </summary>
32- /// <param name="manager">The graphics manager used to create the shaders.</param>
33- /// <param name="vertexShader">The per-vertex shader (in SPIR-V compiled).</param>
34- /// <param name="fragmentShader">The per-pixel shader (in SPIR-V compiled).</param>
35- /// <param name="geometryShader">The geometry shader (in SPIR-V compiled).</param>
36- protected Material ( GraphicsManager manager , byte [ ] vertexShader , byte [ ] ? fragmentShader = null , byte [ ] ? geometryShader = null ) {
37-
31+ /// <param name="shader">The shader corresponding to this material.</param>
32+ protected Material ( IShader shader ) {
33+ Shader = shader ;
3834 }
3935
40- /// <inheritdoc/>
41- public virtual ReadOnlyCollection < AttributeType > RequiredUniforms => RequiredUniforms ;
36+ protected bool SetUniform ( ) {
37+
38+ }
4239}
0 commit comments