Exemplo n.º 1
0
        public ImageEffectShader GetShader(RenderDrawContext context, IVoxelAttribute attr)
        {
            Matrix ViewProjection = context.RenderContext.RenderView.ViewProjection;

            voxelDebugEffectShader.Parameters.Set(VoxelVisualizationViewShaderKeys.view, ViewProjection);
            voxelDebugEffectShader.Parameters.Set(VoxelVisualizationViewShaderKeys.viewInv, Matrix.Invert(ViewProjection));
            voxelDebugEffectShader.Parameters.Set(VoxelVisualizationViewShaderKeys.background, (Vector4)Background);

            attr.UpdateSamplerLayout("AttributeSamplers[0]");
            attr.ApplyViewParameters(voxelDebugEffectShader.Parameters);
            MarchMethod.UpdateSamplerLayout("marcher");
            MarchMethod.ApplyViewParameters(voxelDebugEffectShader.Parameters);
            voxelDebugEffectShader.Parameters.Set(VoxelVisualizationViewShaderKeys.marcher, MarchMethod.GetMarcher(0));

            ShaderSourceCollection collection = new ShaderSourceCollection
            {
                attr.GetSampler()
            };

            voxelDebugEffectShader.Parameters.Set(MarchAttributesKeys.AttributeSamplers, collection);

            return(voxelDebugEffectShader);
        }
Exemplo n.º 2
0
        public ImageEffectShader GetShader(RenderDrawContext context, IVoxelAttribute attr)
        {
            attr.UpdateSamplerLayout("Attribute");
            attr.ApplyViewParameters(voxelDebugEffectShader.Parameters);
            voxelDebugEffectShader.Parameters.Set(VoxelVisualizationRawShaderKeys.Attribute, attr.GetSampler());
            voxelDebugEffectShader.Parameters.Set(VoxelVisualizationRawShaderKeys.mip, Mipmap);
            voxelDebugEffectShader.Parameters.Set(VoxelVisualizationRawShaderKeys.rangeOffset, RangeOffset);
            voxelDebugEffectShader.Parameters.Set(VoxelVisualizationRawShaderKeys.range, Range);

            return(voxelDebugEffectShader);
        }