public MyComputeShaderTextureId AddComputeShaderTextureTemplate(MyComputeShaderTextureTemplate template)
        {
            var textureId = new MyComputeShaderTextureId()
            {
                Id = _lastTextureId++
            };

            _computeShaderTextureTemplates[textureId] = template;
            return(textureId);
        }
Example #2
0
        private Texture CreateTexture(MyComputeShaderTextureTemplate template)
        {
            var texture = new RenderTexture(template.Size.X, template.Size.Y, template.Depth, template.Format);

            texture.enableRandomWrite = template.EnableReadWrite;
            texture.wrapMode          = template.TexWrapMode;
            if (template.Dimension.HasValue)
            {
                texture.dimension = template.Dimension.Value;
            }
            if (template.VolumeDepth.HasValue)
            {
                texture.volumeDepth = template.VolumeDepth.Value;
            }
            texture.Create();
            return(texture);
        }