public override void AfterGpuStroke(PaintCommand.Painter command) //Brush br, Stroke st, BrushTypes.Base type)
 {
     if (painter.Is3DBrush(command.Brush) && painter.IsAtlased())
     {
         PainterShaderVariables.BRUSH_ATLAS_SECTION_AND_ROWS.GlobalValue = new Vector4(0, 0, 1, 0);
     }
 }
        public override void BeforeGpuStroke(PaintCommand.Painter command) //Brush br, Stroke st, BrushTypes.Base type)
        {
            if (!painter.Is3DBrush(command.Brush) || !painter.IsAtlased())
            {
                return;
            }

            var ats = GetAtlasedSection();

            PainterShaderVariables.BRUSH_ATLAS_SECTION_AND_ROWS.GlobalValue = new Vector4(ats.x, ats.y, atlasRows, 1);
        }
Пример #3
0
            public virtual void AfterStroke(PaintCommand.UV command)
            {
                PaintCommand.Painter painterCommand = command as PaintCommand.Painter;
                Brush       br = command.Brush;
                Stroke      st = command.Stroke;
                TextureMeta id = command.TextureData;

                command.OnStrokeComplete();

                if (br.useMask && st.MouseUpEvent && br.randomMaskOffset)
                {
                    br.maskOffset = new Vector2(Random.Range(0f, 1f), Random.Range(0f, 1f));
                }

                if (command.usedAlphaBuffer)
                {
                    var sh = br.GetBlitMode(false).ShaderForAlphaBufferBlit;
                    if (painterCommand == null || painterCommand.painter.NotUsingPreview)
                    {
                        TexMGMT.UpdateFromAlphaBuffer(id.CurrentRenderTexture(), sh);
                    }
                    else
                    {
                        TexMGMT.AlphaBufferSetDirtyBeforeRender(id, sh);
                    }
                }
                else if (!br.IsSingleBufferBrush() && !command.Is3DBrush)
                {
                    TexMGMT.UpdateBufferSegment();
                }

                if (painterCommand != null)
                {
                    foreach (var p in painterCommand.painter.Modules)
                    {
                        p.AfterGpuStroke(painterCommand);
                    }
                }
            }
Пример #4
0
            public void BeforeStroke(PaintCommand.UV command)//Brush br, Stroke st, PlaytimePainter painter = null)
            {
                Brush  br = command.Brush;
                Stroke st = command.Stroke;

                PaintCommand.Painter painterCommand = command as PaintCommand.Painter;

                var cam = TexMGMT;

                if (!RenderTextureBuffersManager.secondBufferUpdated)
                {
                    RenderTextureBuffersManager.UpdateBufferTwo();
                }

                if (painterCommand != null)
                {
                    foreach (var p in painterCommand.painter.Modules)
                    {
                        p.BeforeGpuStroke(painterCommand);//br, st, this);
                    }
                }
            }
Пример #5
0
        }                                                                    //Brush br, Stroke st, BrushTypes.Base type) { }

        public virtual void AfterGpuStroke(PaintCommand.Painter command)
        {
        }                                                                  //Brush br, Stroke st, BrushTypes.Base type) {