コード例 #1
0
        public Terrain()
        {
            batch   = new TerrainBatch();
            batches = new[] { batch };

            material = new Material("shaders/Terrain.shader");

            uboTess = new TessUBO
            {
                lightPos            = new vec4(-48.0f, -40.0f, 46.0f, 0.0f),
                displacementFactor  = 32.0f,
                tessellationFactor  = 0.75f,
                tessellatedEdgeSize = 20.0f
            };

            batch.material = material;

            ubTess = new SharedBuffer(VkBufferUsageFlags.UniformBuffer, (uint)Utilities.SizeOf <TessUBO>());

            dsLayout = new DescriptorSetLayout
            {
                new DescriptorSetLayoutBinding(0, VkDescriptorType.UniformBuffer, VkShaderStageFlags.Fragment | VkShaderStageFlags.TessellationControl | VkShaderStageFlags.TessellationEvaluation),
                new DescriptorSetLayoutBinding(1, VkDescriptorType.CombinedImageSampler, VkShaderStageFlags.Fragment | VkShaderStageFlags.TessellationControl | VkShaderStageFlags.TessellationEvaluation),
                new DescriptorSetLayoutBinding(2, VkDescriptorType.CombinedImageSampler, VkShaderStageFlags.Fragment | VkShaderStageFlags.TessellationControl | VkShaderStageFlags.TessellationEvaluation),
            };

            dsTess = new DescriptorSet(dsLayout);
            dsTess.Bind(0, ubTess);
        }
コード例 #2
0
 public void MarkDirty()
 {
     descriptorSet.Bind(resourceInfo.binding, this);
 }