alelievr / Mixture

Mixture is a powerful node-based tool crafted in unity to generate all kinds of textures in realtime
https://trello.com/b/2JiH2Vsp/mixture
MIT License
1.18k stars 124 forks source link

[BUG] The double buffered option for shaderNode is incorrect #65

Open o2co2 opened 10 months ago

o2co2 commented 10 months ago

What happened? The double buffered option for shaderNode is incorrect

To Reproduce Steps to reproduce the behavior: image

Setup:

Additional informations Add any other context about the problem here.

o2co2 commented 10 months ago
        if (settings.doubleBuffered)
        {
             CustomRenderTextureUpdateZone[] updateZones;

            switch (output.dimension)
            {
                default:
                case TextureDimension.Cube: 
                    throw new NotImplementedException();
                case TextureDimension.Tex2D:
                    updateZones = new CustomRenderTextureUpdateZone[]
                    {
                        new CustomRenderTextureUpdateZone
                        {
                            needSwap = true,
                            passIndex = 0,
                            rotation = 0f, 
                            updateZoneCenter = new Vector3(0.5f, 0.5f, 0.5f),
                            updateZoneSize = new Vector3(1f, 1f, 1f),
                        },

                    };
                    break;
                case TextureDimension.Tex3D:
                    throw new NotImplementedException();
                    break;
            }

            settings.doubleBuffered = true;

            // Setup the successive passes needed or the blur
            output.SetUpdateZones(updateZones);
        }