public GenericMaterial(Texture tex, Texture normalMap = null, Texture bumpMap = null) { CompileShaders(); Tex = tex; NormalMap = normalMap; bumpMap = bumpMap; Color = Vector4.One; Mode = GenericMaterial.DrawMode.TextureOnly; }
public void SetRoughnessTexture(string key) { RoughnessTexture = new Texture(Media.Get(key)); }
public void SetAlphaTexture(string key) { AlphaTexture = new Texture(Media.Get(key)); }
public void SetSpecularTexture(string key) { SpecularTexture = new Texture(Media.Get(key)); }
public void SetDiffuseTexture(string key) { DiffuseTexture = new Texture(Media.Get(key)); }
public void SetNormalsTexture(string key) { NormalsTexture = new Texture(Media.Get(key)); }
public void SetBumpTexture(string key) { BumpTexture = new Texture(Media.Get(key)); }
public static Texture FromText(string text, string font, float size, Color textColor, Color background) { var tex = new Texture(); tex.UpdateFromText(text, font, size, textColor, background); return tex; }
public PostProcessing(int initialWidth, int initialHeight) { //FullScene3DTexture = new Texture3D(new Vector3(64, 64, 64)); TestBuffer = new ShaderStorageBuffer(); NumbersTexture = new Texture(Media.Get("numbers.png")); CShader = new ComputeShader("Blur.compute.glsl"); GLThread.Invoke(() => { TestBuffer.MapData(new Vector3[4]{ new Vector3(1, 0.25f, 1), new Vector3(0, 0.55f, 0.75f), new Vector3(1, 0.25f, 0), new Vector3(0.55f, 0, 0.75f) }); }); Width = initialWidth; Height = initialHeight; MSAAResolvingFrameBuffer = new Framebuffer(initialWidth, initialHeight); MSAAResolvingFrameBuffer.SetMultiSample(true); MRT = new MRTFramebuffer(initialWidth, initialHeight); BackMRT = new MRTFramebuffer(initialWidth / 4, initialHeight / 4); Pass1FrameBuffer = new Framebuffer(initialWidth, initialHeight); Pass2FrameBuffer = new Framebuffer(initialWidth, initialHeight); LightPointsFrameBuffer = new Framebuffer(initialWidth / 6, initialHeight / 6); BloomFrameBuffer = new Framebuffer(initialWidth / 4, initialHeight / 4); FogFramebuffer = new Framebuffer(initialWidth, initialHeight); SmallFrameBuffer = new Framebuffer(initialWidth / 10, initialHeight / 10); LastWorldPositionFramebuffer = new Framebuffer(initialWidth / 1, initialHeight / 1); RSMFramebuffer = new Framebuffer(initialWidth / 1, initialHeight / 1); SSReflectionsFramebuffer = new Framebuffer(initialWidth / 1, initialHeight / 1); VDAOFramebuffer = new Framebuffer(initialWidth / 1, initialHeight / 1); GlobalIlluminationFrameBuffer = new Framebuffer(initialWidth, initialHeight); //GlobalIlluminationFrameBuffer.ColorInternalFormat = PixelInternalFormat.R8; //GlobalIlluminationFrameBuffer.ColorPixelFormat = PixelFormat.Red; //GlobalIlluminationFrameBuffer.ColorPixelType = PixelType.UnsignedByte; GlobalIlluminationFrameBuffer.Use(); //BackDiffuseFrameBuffer = new Framebuffer(initialWidth / 2, initialHeight / 2); //BackNormalsFrameBuffer = new Framebuffer(initialWidth / 2, initialHeight / 2); ScreenSpaceNormalsWriterShader = ShaderProgram.Compile("Generic.vertex.glsl", "ScreenSpaceNormalsWriter.fragment.glsl"); BackDepthWriterShader = ShaderProgram.Compile("Generic.vertex.glsl", "BackDepthWriter.fragment.glsl"); BloomShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "Bloom.fragment.glsl"); MSAAShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "MSAA.fragment.glsl"); SSAOShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "SSAO.fragment.glsl"); FogShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "Fog.fragment.glsl"); LightPointsShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "LightPoints.fragment.glsl"); LensBlurShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "LensBlur.fragment.glsl"); HDRShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "HDR.fragment.glsl"); BlitShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "Blit.fragment.glsl"); DeferredShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "Deferred.fragment.glsl"); CombinerShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "Combiner.fragment.glsl"); PathTracerOutputShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "Output.fragment.glsl"); GlobalIlluminationShaderX = ShaderProgram.Compile("PostProcess.vertex.glsl", "GlobalIllumination.fragment.glsl"); GlobalIlluminationShaderX.SetGlobal("SEED", "gl_FragCoord.x"); GlobalIlluminationShaderY = ShaderProgram.Compile("PostProcess.vertex.glsl", "GlobalIllumination.fragment.glsl"); GlobalIlluminationShaderY.SetGlobal("SEED", "gl_FragCoord.y"); RSMShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "RSM.fragment.glsl"); SSReflectionsShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "SSReflections.fragment.glsl"); VDAOShader = ShaderProgram.Compile("PostProcess.vertex.glsl", "VDAO.fragment.glsl"); //ReflectShader = ShaderProgram.Compile(Media.ReadAllText("PostProcess.vertex.glsl"), Media.ReadAllText("Reflect.fragment.glsl")); Object3dInfo postPlane3dInfo = new Object3dInfo(postProcessingPlaneVertices, postProcessingPlaneIndices); PostProcessingMesh = new Mesh3d(postPlane3dInfo, new GenericMaterial(Color.Pink)); }
public void SetTextureFromMedia(string textKey) { Tex = new Texture(Media.Get(textKey)); }
public void SetNormalMapFromMedia(string mapKey) { NormalMap = new Texture(Media.Get(mapKey)); }
public void SetBumpMapFromMedia(string bumpmapKey) { BumpMap = new Texture(Media.Get(bumpmapKey)); }
public void SetAlphaMaskFromMedia(string key) { AlphaMask = new Texture(Media.Get(key)); }