protected override void DoInitialize()
{
{
// Initialize our compute program
var shaderCode = new ShaderCode(File.ReadAllText(@"shaders\SimpleComputeRenderer\compute.comp"), ShaderType.ComputeShader);
this.computeProgram = shaderCode.CreateProgram();
}
{
// Initialize our resetProgram
var shaderCode = new ShaderCode(File.ReadAllText(@"shaders\SimpleComputeRenderer\computeReset.comp"), ShaderType.ComputeShader);
this.computeResetProgram = shaderCode.CreateProgram();
}
{
// This is the texture that the compute program will write into
var texture = new Texture(TextureTarget.Texture2D,
new TexStorage2DImageFiller(8, OpenGL.GL_RGBA32F, 256, 256),
new NullSampler());
texture.Initialize();
this.outputImage = texture;
}
{
this.GroupX = 1;
this.GroupY = 1;
this.GroupZ = 1;
}
base.DoInitialize();
this.SetUniform("output_image", this.outputImage);
}