private MaterialNodeClassLoader() { manager = new ShaderSourceManager(); manager.LookupDirectoryList.Add(EffectCompilerBase.DefaultSourceShaderFolder); logger = new SiliconStudio.Shaders.Utility.LoggerResult(); loader = new ShaderLoader(manager); }
public void Init() { // Create and mount database file system var objDatabase = ObjectDatabase.CreateDefaultDatabase(); var databaseFileProvider = new DatabaseFileProvider(objDatabase); AssetManager.GetFileProvider = () => databaseFileProvider; sourceManager = new ShaderSourceManager(); sourceManager.LookupDirectoryList.Add(@"shaders"); shaderLoader = new ShaderLoader(sourceManager); }
public void Init() { // Create and mount database file system var objDatabase = new ObjectDatabase("/data/db", "index", "/local/db"); var databaseFileProvider = new DatabaseFileProvider(objDatabase); AssetManager.GetFileProvider = () => databaseFileProvider; manager = new ShaderSourceManager(); manager.LookupDirectoryList.Add("shaders"); logger = new SiliconStudio.Shaders.Utility.LoggerResult(); loader = new ShaderLoader(manager); }
public void Init() { // Create and mount database file system var objDatabase = ObjectDatabase.CreateDefaultDatabase(); var databaseFileProvider = new DatabaseFileProvider(objDatabase); ContentManager.GetFileProvider = () => databaseFileProvider; manager = new ShaderSourceManager(); manager.LookupDirectoryList.Add("shaders"); logger = new SiliconStudio.Shaders.Utility.LoggerResult(); loader = new ShaderLoader(manager); }
public void Init() { // Create and mount database file system var objDatabase = new ObjectDatabase("/data/db", "index", "/local/db"); var databaseFileProvider = new DatabaseFileProvider(objDatabase); AssetManager.GetFileProvider = () => databaseFileProvider; sourceManager = new ShaderSourceManager(); sourceManager.LookupDirectoryList.Add(@"shaders"); shaderLoader = new ShaderLoader(sourceManager); shaderMixinParser = new ShaderMixinParser(AssetManager.FileProvider); shaderMixinParser.SourceManager.LookupDirectoryList.Add(@"shaders"); }
/// <summary> /// Initializes a new instance of the <see cref="ShaderMixinParser"/> class. /// </summary> public ShaderMixinParser(IVirtualFileProvider fileProvider) { SourceManager = new ShaderSourceManager(fileProvider); var shaderLoader = new ShaderLoader(SourceManager); if (shaderLibrary == null) { shaderLibrary = new ParadoxShaderLibrary(shaderLoader); } // Create the clone context with the instances of Hlsl classes HlslSemanticAnalysis.FillCloneContext(hlslCloneContext); }
protected override void OnDestruct() { Textures.Unsubscribe(); Shaders.Unsubscribe(); ShaderLoader.Unsubscribe(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Title = "Rotate And Then Translate A Triangle"; Width = 400; Height = 400; Console.WriteLine("Version: " + GL.GetString(StringName.Version)); Console.WriteLine("Video Adapter: " + GL.GetString(StringName.Renderer)); // Load shaders from files string vShaderSource = null; string fShaderSource = null; ShaderLoader.LoadShader("./Shaders/VertexShader.glsl", out vShaderSource); ShaderLoader.LoadShader("./Shaders/FragmentShader.glsl", out fShaderSource); if (vShaderSource == null) { Logger.Append("Failed to load vertex shader from file"); return; } if (fShaderSource == null) { Logger.Append("Failed to load fragment shader from file"); return; } // Initialize shaders if (!ShaderLoader.InitShaders(vShaderSource, fShaderSource, out program)) { Logger.Append("Failed to initialize shaders"); return; } // Write the positions of vertices to a vertex shader nVertices = InitVertexBuffers(); if (nVertices < 0) { Logger.Append("Failed to set the positions of the vertices"); return; } float ANGLE = 60f; // The rotation angle var Tx = 0.5f; // Translation distance // Create Matrix4 object for model transformation // And calculate a model matrix Matrix4 modelMatrix = Matrix4.CreateRotationZ(ANGLE * (float)Math.PI / 180f) * Matrix4.CreateTranslation(Tx, 0f, 0f); // Pass the model matrix to the vertex shader int u_ModelMatrix = GL.GetUniformLocation(program, "u_ModelMatrix"); if (u_ModelMatrix < 0) { Logger.Append("Failed to get the storage location of u_ModelMatrix"); return; } GL.UniformMatrix4(u_ModelMatrix, false, ref modelMatrix); // Specify color for clearing canvas GL.ClearColor(Color.Black); canDraw = true; }
public override void Load() { ShaderLoader.RegisterMod(this); }
private void Inject(ShaderLoader shaderLoader, Settings settings) { _shaderLoader = shaderLoader; _settings = settings; }
/// <summary> /// Creates a new <see cref="CachedShader"/> instance with the specified parameters /// </summary> /// <param name="loader">The <see cref="ShaderLoader"/> instance with the shader metadata</param> /// <param name="bytecode">The compiled shader bytecode</param> public CachedShader(ShaderLoader <T> loader, ShaderBytecode bytecode) { Loader = loader; Bytecode = bytecode; }
public ResourceVertFragShaderFile(string sVertexShdFile_, string sFragmentShdFile_) { shader = ShaderLoader.FromFiles(sVertexShdFile_, sFragmentShdFile_); }
public override bool PreDraw(Projectile projectile, SpriteBatch spriteBatch, Color lightColor) { ShaderLoader.ProjectileShader(projectile, spriteBatch, lightColor); return(true); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Title = "Rotate A Triangle (Matrix4)"; Width = 400; Height = 400; Console.WriteLine("Version: " + GL.GetString(StringName.Version)); Console.WriteLine("Video Adapter: " + GL.GetString(StringName.Renderer)); // Load shaders from files string vShaderSource = null; string fShaderSource = null; ShaderLoader.LoadShader("./Shaders/VertexShader.glsl", out vShaderSource); ShaderLoader.LoadShader("./Shaders/FragmentShader.glsl", out fShaderSource); if (vShaderSource == null) { Logger.Append("Failed to load the vertex shader from a file"); return; } if (fShaderSource == null) { Logger.Append("Failed to load the fragment shader from a file"); return; } // Initialize shaders if (!ShaderLoader.InitShaders(vShaderSource, fShaderSource, out program)) { Logger.Append("Failed to initialize the shaders"); return; } // Write the positions of vertices to a vertex shader nVertices = InitVertexBuffers(); if (nVertices < 0) { Logger.Append("Failed to write the positions of vertices to a vertex shader"); return; } // Create Matrix4 object for the rotation matrix Matrix4 modelMatrix = new Matrix4(); // Set the rotation matrix float ANGLE = 90 * (float)Math.PI / 180f; modelMatrix = Matrix4.CreateRotationZ(ANGLE); // Pass the rotation matrix to the vertex shader u_MvpMatrix = GL.GetUniformLocation(program, "u_MvpMatrix"); if (u_MvpMatrix < 0) { Logger.Append("Failed to get the storage location of u_MvpMatrix"); return; } GL.UniformMatrix4(u_MvpMatrix, false, ref modelMatrix); WindowBorder = WindowBorder.Fixed; //viewProjMatrix = Matrix4.CreatePerspectiveFieldOfView(0.8, ) // Specify the color for clearing the canvas GL.ClearColor(Color.Black); canDraw = true; }
public override void AddShaderLoader(ShaderLoader loader) { _shaderLoaders.Add(loader); }
public void AddValidSourceVert() { var loader = new ShaderLoader(); Assert.IsTrue(loader.AddSource("vert1", File.ReadAllText("Shaders/valid.vert"), ShaderType.VertexShader)); }
public void AddInvalidSource() { var loader = new ShaderLoader(); Assert.IsFalse(loader.AddSource("frag1", @"¯\_( ͡° ͜ʖ ͡°)_/¯", ShaderType.FragmentShader)); }
public void AddValidSourceFrag() { var loader = new ShaderLoader(); Assert.IsTrue(loader.AddSource("frag1", File.ReadAllText("Shaders/valid.frag"), ShaderType.FragmentShader)); }
public MirrorHelper(ILogger <MirrorHelper> logger, DiContainer container, ShaderLoader shaderLoader) { _logger = logger; _container = container; _shaderLoader = shaderLoader; }
public static bool LoadAmplifyShaders() { LogDebug("Loading Amplify Occlusion shaders"); return(ShaderLoader.Initialize(Path.Combine(Application.streamingAssetsPath, AMPLIFY_SHADERS))); }
public static bool LoadSteamVRShaders() { LogDebug("Loading steamvr_shaders"); return(ShaderLoader.Initialize(Path.Combine(Application.streamingAssetsPath, STEAM_VR_SHADERS))); }
public override bool PreDrawInInventory(Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { ShaderLoader.ItemInventoryShader(item, spriteBatch, position, frame, drawColor, itemColor, origin, scale); return(true); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Title = "Shadow"; // Load shader from files string vShadowShaderSource = null; string fShadowShaderSource = null; string vShaderSource = null; string fShaderSource = null; ShaderLoader.LoadShader("./Shaders/ShadowVertexShader.glsl", out vShadowShaderSource); ShaderLoader.LoadShader("./Shaders/ShadowFragmentShader.glsl", out fShadowShaderSource); ShaderLoader.LoadShader("./Shaders/VertexShader.glsl", out vShaderSource); ShaderLoader.LoadShader("./Shaders/FragmentShader.glsl", out fShaderSource); if (vShadowShaderSource == null || fShadowShaderSource == null || vShaderSource == null || fShaderSource == null) { Logger.Append("Failed to load vertex or framgment shader"); return; } // Initialize shaders for generating a shadow map shadowProgram.id = ShaderLoader.CreateProgram(vShadowShaderSource, fShadowShaderSource); if (shadowProgram.id == 0) { Logger.Append("Failed to crate a shadow program"); return; } shadowProgram.a_Position = GL.GetAttribLocation(shadowProgram.id, "a_Position"); shadowProgram.u_MvpMatrix = GL.GetUniformLocation(shadowProgram.id, "u_MvpMatrix"); if (shadowProgram.a_Position < 0 || shadowProgram.u_MvpMatrix < 0) { Logger.Append("Failed to get the storage location of attribute or uniform variable from shadowProgram"); return; } // Initialize shaders for regular drawing normalProgram.id = ShaderLoader.CreateProgram(vShaderSource, fShaderSource); if (normalProgram.id == 0) { Logger.Append("Failed to crate a normal program"); return; } normalProgram.a_Position = GL.GetAttribLocation(normalProgram.id, "a_Position"); normalProgram.a_Color = GL.GetAttribLocation(normalProgram.id, "a_Color"); normalProgram.u_MvpMatrix = GL.GetUniformLocation(normalProgram.id, "u_MvpMatrix"); normalProgram.u_MvpMatrixFromLight = GL.GetUniformLocation(normalProgram.id, "u_MvpMatrixFromLight"); normalProgram.u_ShadowMap = GL.GetUniformLocation(normalProgram.id, "u_ShadowMap"); if (normalProgram.a_Position < 0 || normalProgram.a_Color < 0 || normalProgram.u_MvpMatrix < 0 || normalProgram.u_MvpMatrixFromLight < 0 || normalProgram.u_ShadowMap < 0) { Logger.Append("Failed to get the storage location of attribute or uniform variable from normalProgram"); return; } // Set the vertex information triangle = InitVertexBuffersForTriangle(); plane = InitVertexBuffersForPlane(); if (triangle == null || plane == null) { Logger.Append("Failed to set the vertex information"); return; } // Initialize framebuffer object (FBO) fbo = InitFramebufferObject(); if (fbo == null) { Logger.Append("Failed to intialize the framebuffer object (FBO)"); return; } GL.ActiveTexture(TextureUnit.Texture0); // Set a texture object to the texture unit GL.BindTexture(TextureTarget.Texture2D, fbo.texture); // Set the clear color and enable the depth test GL.ClearColor(Color4.Black); GL.Enable(EnableCap.DepthTest); // GL.Enable(EnableCap.CullFace); viewMatrixFromLight = Matrix4.LookAt(LIGHT_X, LIGHT_Y, LIGHT_Z, 0f, 0f, 0f, 0f, 1f, 0f); viewMatrix = Matrix4.LookAt(0f, 7f, 9f, 0f, 0f, 0f, 0f, 1f, 0f); SetProjMatrixes(); canDraw = true; }
public override bool PreDrawInWorld(Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { ShaderLoader.ItemWorldShader(item, spriteBatch, lightColor, alphaColor, ref rotation, ref scale, whoAmI); return(true); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Load shader from files string vShaderSource = null; string fShaderSource = null; ShaderLoader.LoadShader("./Shaders/VertexShader.glsl", out vShaderSource); ShaderLoader.LoadShader("./Shaders/FragmentShader.glsl", out fShaderSource); if (vShaderSource == null || fShaderSource == null) { Logger.Append("Failed to load vertex or framgment shader"); return; } // Initialize the shaders if (!ShaderLoader.InitShaders(vShaderSource, fShaderSource, out program.id)) { Logger.Append("Failed to initialize the shaders"); return; } // Get the storage location of attribute variables and uniform variables program.a_Position = GL.GetAttribLocation(program.id, "a_Position"); program.a_TexCoord = GL.GetAttribLocation(program.id, "a_TexCoord"); program.u_MvpMatrix = GL.GetUniformLocation(program.id, "u_MvpMatrix"); if (program.a_Position < 0 || program.a_TexCoord < 0 || program.u_MvpMatrix < 0) { Logger.Append("Failed to get the storage location of a_Position, a_TexCoord, u_MvpMatrix"); return; } // Set the vertex information cube = InitVertexBuffersForCube(); plane = InitVertexBuffersForPlane(); if (cube == null || plane == null) { Logger.Append("Failed to set the vertex information"); return; } // Set texture texture = InitTextures(); if (texture < 0) { Logger.Append("Failed to intialize the texture"); return; } // Initialize framebuffer object (FBO) frameBuffer = InitFramebufferObject(); if (frameBuffer == null) { Logger.Append("Failed to intialize the framebuffer object (FBO)"); return; } // Enable depth test GL.Enable(EnableCap.DepthTest); // GL.Enable(EnableCap.CullFace); modelMatrix = Matrix4.Identity; viewMatrix = Matrix4.LookAt(0f, 0f, 5f, 0f, 0f, 0f, 0f, 1f, 0f); // Prepare view projection matrix for color buffer SetProjMatrix(); projMatrixFBO = Matrix4.CreatePerspectiveFieldOfView(0.8f, OFFSCREEN_WIDTH / (float)OFFSCREEN_HEIGHT, 0.1f, 100f); // The projection matrix viewMatrixFBO = Matrix4.LookAt(0f, 2f, 7f, 0f, 0f, 0f, 0f, 1f, 0f); // The view matrix modelMatrixFBO = Matrix4.Identity; mvpMatrixFBO = modelMatrixFBO * viewMatrixFBO * projMatrixFBO; canDraw = true; }
public XenkoShaderLibrary(ShaderLoader loader) { ShaderLoader = loader; }
public MirrorHelper(ILoggerProvider loggerProvider, DiContainer container, ShaderLoader shaderLoader) { _logger = loggerProvider.CreateLogger <MirrorHelper>(); _container = container; _shaderLoader = shaderLoader; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Title = "Rotate A Triangle"; Width = 400; Height = 400; Console.WriteLine("OpenGL Version: " + GL.GetString(StringName.Version)); Console.WriteLine("Video Adapter: " + GL.GetString(StringName.Renderer)); // Load shaders from files string vShaderSource = null; string fShaderSource = null; ShaderLoader.LoadShader("./Shaders/VertexShader.glsl", out vShaderSource); ShaderLoader.LoadShader("./Shaders/FragmentShader.glsl", out fShaderSource); if (vShaderSource == null) { Logger.Append("Failed to load the vertex shader from a file"); return; } if (fShaderSource == null) { Logger.Append("Failed to load the fragment shader from a file"); return; } // Initialize the shaders if (!ShaderLoader.InitShaders(vShaderSource, fShaderSource, out program)) { Logger.Append("Failed to initialize the shaders"); return; } // Write the positions of vertices to a vertex shader nVertices = InitVertexBuffers(); if (nVertices < 0) { Logger.Append("Failed to write the positions of vertices to a vertex shader"); return; } // Pass the data required to rotate the shape to the vertex shader double radian = angle * Math.PI / 180.0; cosB = Math.Cos(radian); sinB = Math.Sin(radian); // Get the storage location of u_CosB u_CosB = GL.GetUniformLocation(program, "u_CosB"); if (u_CosB < 0) { Logger.Append("Failed to get the storage location of u_CosB"); return; } // Get the storage location of u_SinB u_SinB = GL.GetUniformLocation(program, "u_SinB"); if (u_SinB < 0) { Logger.Append("Failed to get the storage location of u_SinB"); return; } GL.Uniform1(u_CosB, (float)cosB); GL.Uniform1(u_SinB, (float)sinB); // Specify the color for clearing the canvas GL.ClearColor(Color.Black); canDraw = true; }
/// <summary> /// Load the shader and extract the information. /// </summary> public static void PrepareNode <T>(this ComputeShaderClassBase <T> _this, ConcurrentDictionary <string, string> projectShaders) where T : class, IComputeNode { // TODO: merge common keys between the previous dictionaries and the new one _this.Generics.Clear(); _this.CompositionNodes.Clear(); if (string.IsNullOrEmpty(_this.MixinReference)) { return; } var newGenerics = new ComputeColorParameters(); var newCompositionNodes = new Dictionary <string, T>(); var newMembers = new Dictionary <ParameterKey, object>(); var localMixinName = _this.MixinReference; ShaderClassType shader = null; string source; if (projectShaders.TryGetValue(localMixinName, out source)) { var logger = new LoggerResult(); try { shader = ShaderLoader.ParseSource(source, logger); if (logger.HasErrors) { logger.Messages.Clear(); return; } } catch { // TODO: output messages return; } } if (shader == null) { return; } var acceptLinkedVariable = true; foreach (var generic in shader.ShaderGenerics) { if (generic.Type.Name.Text == "float4") { _this.AddKey <Vector4>(generic.Name.Text, newGenerics); } else if (generic.Type.Name.Text == "float3") { _this.AddKey <Vector3>(generic.Name.Text, newGenerics); } else if (generic.Type.Name.Text == "float2") { _this.AddKey <Vector2>(generic.Name.Text, newGenerics); } else if (generic.Type.Name.Text == "float") { _this.AddKey <float>(generic.Name.Text, newGenerics); } else if (generic.Type.Name.Text == "int") { _this.AddKey <int>(generic.Name.Text, newGenerics); } else if (generic.Type.Name.Text == "Texture2D") { _this.AddKey <Graphics.Texture>(generic.Name.Text, newGenerics); } else if (generic.Type.Name.Text == "SamplerState") { _this.AddKey <SamplerState>(generic.Name.Text, newGenerics); } else { _this.AddKey <string>(generic.Name.Text, newGenerics); } if (generic.Type is LinkType) { acceptLinkedVariable = false; // since the behavior is unpredictable, safely prevent addition of linked variable (= with Link annotation) } } foreach (var member in shader.Members.OfType <Variable>()) { // TODO: enough detect compositions? if (member.Type is TypeName && (member.Type.TypeInference == null || member.Type.TypeInference.TargetType == null)) { // ComputeColor only if (member.Type.Name.Text == "ComputeColor") { if (_this.CompositionNodes.ContainsKey(member.Name.Text)) { newCompositionNodes.Add(member.Name.Text, _this.CompositionNodes[member.Name.Text]); } else { newCompositionNodes.Add(member.Name.Text, null); } } } else { var isColor = false; string linkName = null; var isStage = member.Qualifiers.Contains(ParadoxStorageQualifier.Stage); var isStream = member.Qualifiers.Contains(ParadoxStorageQualifier.Stream); foreach (var annotation in member.Attributes.OfType <SiliconStudio.Shaders.Ast.Hlsl.AttributeDeclaration>()) { if (annotation.Name == "Color") { isColor = true; } if (acceptLinkedVariable && annotation.Name == "Link" && annotation.Parameters.Count > 0) { linkName = (string)annotation.Parameters[0].Value; } } if (!isStream && (isStage || !string.IsNullOrEmpty(linkName))) { if (linkName == null) { linkName = localMixinName + "." + member.Name.Text; } var memberType = member.Type.ResolveType(); if (isColor) { _this.AddMember <Color4>(linkName, newMembers); } else if (memberType == ScalarType.Float || memberType == ScalarType.Half) { _this.AddMember <float>(linkName, newMembers); } else if (memberType == ScalarType.Double) { _this.AddMember <double>(linkName, newMembers); } else if (memberType == ScalarType.Int) { _this.AddMember <int>(linkName, newMembers); } else if (memberType == ScalarType.UInt) { _this.AddMember <uint>(linkName, newMembers); } else if (memberType == ScalarType.Bool) { _this.AddMember <bool>(linkName, newMembers); } else if (memberType is VectorType) { switch (((VectorType)memberType).Dimension) { case 2: _this.AddMember <Vector2>(linkName, newMembers); break; case 3: _this.AddMember <Vector3>(linkName, newMembers); break; case 4: _this.AddMember <Vector4>(linkName, newMembers); break; } } else if (member.Type.Name.Text == "Texture2D") { _this.AddMember <Graphics.Texture>(linkName, newMembers); } else if (member.Type.Name.Text == "SamplerState") { _this.AddMember <Graphics.SamplerState>(linkName, newMembers); } } } } _this.Generics = newGenerics; _this.CompositionNodes = newCompositionNodes; _this.Members = newMembers; }
/// <summary> /// Creates a new <see cref="CachedShader{T}"/> instance with the specified parameters /// </summary> /// <param name="loader">The <see cref="ShaderLoader{T}"/> instance with the shader metadata</param> /// <param name="bytecode">The compiled shader bytecode</param> public CachedShader(ShaderLoader <T> loader, ShaderBytecode bytecode) { Loader = loader; Bytecode = bytecode; CachedPipelines = new ConditionalWeakTable <GraphicsDevice, PipelineState>(); }
/// <summary> /// Creates a new <see cref="CachedShader{T}"/> instance with the specified parameters. /// </summary> /// <param name="loader">The <see cref="ShaderLoader{T}"/> instance with the shader metadata.</param> /// <param name="bytecode">The compiled shader bytecode.</param> public CachedShader(ShaderLoader <T> loader, IDxcBlobObject bytecode) { Loader = loader; Bytecode = bytecode; CachedPipelines = new(); }
void Awake() { ShaderLoader.LoadAssetBundle("KopernicusExpansion/Shaders", "emissivefx"); }
void Awake() { ShaderLoader.LoadAssetBundle("KopernicusExpansion/Shaders", "proceduralgasgiants"); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Title = "Rotate A Triangle (Matrix)"; Width = 400; Height = 400; Console.WriteLine("OpenGL Version: " + GL.GetString(StringName.Version)); Console.WriteLine("Video Adapter: " + GL.GetString(StringName.Renderer)); // Load shaders from files string vShaderSource = null; string fShaderSource = null; ShaderLoader.LoadShader("./Shaders/VertexShader.glsl", out vShaderSource); ShaderLoader.LoadShader("./Shaders/FragmentShader.glsl", out fShaderSource); if (vShaderSource == null) { Logger.Append("Failed to load the vertex shader from a file"); return; } if (fShaderSource == null) { Logger.Append("Failed to load the fragment shader from a file"); return; } // Initialize the shaders if (!ShaderLoader.InitShaders(vShaderSource, fShaderSource, out program)) { Logger.Append("Failed to initialize the shaders"); return; } // Write the positions of vertices to a vertex shader nVertices = InitVertexBuffers(); if (nVertices < 0) { Logger.Append("Failed to write the positions of vertices to a vertex shader"); return; } // Create a rotation matrix double radian = angle * Math.PI / 180f; // Convert to radians float cosB = (float)Math.Cos(radian); float sinB = (float)Math.Sin(radian); // Note: WebGL is column major order xformMatrix = new Matrix4( cosB, sinB, 0f, 0f, -sinB, cosB, 0f, 0f, 0f, 0f, 1f, 0f, 0f, 0f, 0f, 1f ); // Get the storage location of u_xformMatrix u_xformMatrix = GL.GetUniformLocation(program, "u_xformMatrix"); if (u_xformMatrix < 0) { Logger.Append("Failed to get the storage location of u_xformMatrix"); return; } // Pass the rotation matrix to the vertex shader GL.UniformMatrix4(u_xformMatrix, false, ref xformMatrix); // Specify the color for clearing the canvas GL.ClearColor(Color.Black); canDraw = true; }
public ParadoxShaderLibrary(ShaderLoader loader) { ShaderLoader = loader; }
private Shaders(string directory) { loader = new ShaderLoader(directory, (timedSet, TimeUniform)); }
public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor) { ShaderLoader.NPCShader(npc, spriteBatch, drawColor); return(true); }
void Awake() { ShaderLoader.LoadAssetBundle("KopernicusExpansion/Shaders", "comettail"); }