void initShaders() { shader = new ShadingProgram(); uboShaderSharedData = GL.GenBuffer(); GL.BindBuffer(BufferTarget.UniformBuffer, uboShaderSharedData); GL.BufferData(BufferTarget.UniformBuffer, Marshal.SizeOf(shaderSharedData), ref shaderSharedData, BufferUsageHint.DynamicCopy); GL.BindBuffer(BufferTarget.UniformBuffer, 0); GL.BindBufferBase(BufferRangeTarget.UniformBuffer, 0, uboShaderSharedData); fogData = UBOFogData.CreateUBOFogData(); uboFogData = GL.GenBuffer(); GL.BindBuffer(BufferTarget.UniformBuffer, uboFogData); GL.BufferData(BufferTarget.UniformBuffer, Marshal.SizeOf(fogData), ref fogData, BufferUsageHint.StaticCopy); GL.BindBuffer(BufferTarget.UniformBuffer, 0); GL.BindBufferBase(BufferRangeTarget.UniformBuffer, 1, uboFogData); }
void initShaders() { deformableObjShader = new DeformablesShader("Shaders/objects.vert", "Shaders/objects.frag"); deformableObjShader.ShadowMap = shadowMap; instancedObjShader = new InstancedShader("Shaders/objInstanced.vert", "Shaders/objects.frag"); instancedObjShader.ShadowMap = shadowMap; //objShader.DiffuseTexture = heolienneTex; shaderSharedData = new UniformBufferObject <UBOSharedData> (BufferUsageHint.DynamicCopy); shaderSharedData.Datas.Color = new Vector4(0.8f, 0.8f, 0.8f, 1.0f); shaderSharedData.Datas.Shared.X = 1.0f; shaderSharedData.Datas.SetPass(ShadingPass.Normal); shaderSharedData.Bind(0); fogData = new UniformBufferObject <UBOFogData> ( UBOFogData.CreateUBOFogData(), BufferUsageHint.StaticCopy); fogData.Bind(1); material = new UniformBufferObject <UBOMaterialData> (BufferUsageHint.DynamicCopy); material.Bind(2); }
void initShaders() { shader = new ShadingProgram (); uboShaderSharedData = GL.GenBuffer (); GL.BindBuffer (BufferTarget.UniformBuffer, uboShaderSharedData); GL.BufferData(BufferTarget.UniformBuffer,Marshal.SizeOf(shaderSharedData), ref shaderSharedData, BufferUsageHint.DynamicCopy); GL.BindBuffer (BufferTarget.UniformBuffer, 0); GL.BindBufferBase (BufferRangeTarget.UniformBuffer, 0, uboShaderSharedData); fogData = UBOFogData.CreateUBOFogData(); uboFogData = GL.GenBuffer (); GL.BindBuffer (BufferTarget.UniformBuffer, uboFogData); GL.BufferData(BufferTarget.UniformBuffer,Marshal.SizeOf(fogData), ref fogData, BufferUsageHint.StaticCopy); GL.BindBuffer (BufferTarget.UniformBuffer, 0); GL.BindBufferBase (BufferRangeTarget.UniformBuffer, 1, uboFogData); }