Giter VIP home page Giter VIP logo

batchbreakingcause's Introduction

Batch Breaking Cause

This project demonstrates different cases when Unity has to break a batch while rendering.
Best used with Unity 5.6b4+ where the Frame Debugger window shows why Unity had to start a new batch.

Causes

  • Additional Vertex Streams — the object has additional vertex streams set using MeshRenderer.additionalVertexStreams.
  • Deferred Objects on Different Lighting Layers — the object is on a different light layer.
  • Deferred Objects Split by Shadow Distance — one of the objects is within shadow distance, the other one is not.
  • Different Combined Meshes — the object belongs to another combined static mesh.
  • Different Custom Properties — the object has a different MaterialProperyBlock set.
  • Different Lights — the object is affected by a different forward light.
  • Different Materials — the object has a different material.
  • Different Reflection Probes — the object is affected by a different reflection probe.
  • Different Shadow Caster Hash — the objects either have different shadow caster shaders, or have different shader properties / keywords that affect the output of the shadow caster pass.
  • Different Shadow Receiving Settings — the objects either have different "Receive Shadows" settings, or some objects are within the shadow distance, while some other objects are not.
  • Different Static Batching Flags — the object has different static batching settings.
  • Dynamic Batching Disabled to Avoid Z-Fighting — dynamic batching is turned off in Player Settings or disabled temporarily in the current context to avoid z-fighting.
  • Instancing Different Geometries — rendering different meshes or sub-meshes with GPU instancing.
  • Lightmapped Objects — the object uses a different light map or has different light map uv transformations within the same light map.
  • Lightprobe Affected Objects — the object is affected by different light probes.
  • Mixed Sided Mode Shadow Casters — objects have different "Cast Shadows" settings.
  • Multipass — the object is using a multi-pass shader.
  • Multiple Forward Lights — the object is affected by multiple forward lights.
  • Non-instanceable Property Set — non-instanced properties are set for an instanced shader.
  • Odd Negative Scaling — the object has odd negative scaling (e.g. (1, -1, 1)).
  • Shader Disables Batching — the shader explicitly disables batching with the "DisableBatching" tag.
  • Too Many Indices in Dynamic Batch — there are too many indices (more than 32k) in a dynamic batch.
  • Too Many Indices in Static Batch — there are too many indices in the combined mesh of a static batch. The limit is 48k indices on OpenGL ES, 32k on OSX and 64k on other platforms.
  • Too Many Vertex Attributes for Dynamic Batching — a submesh we are trying to dynamically batch has more than 900 vertex attributes.
  • Too Many Vertices for Dynamic Batching — a submesh we are trying to dynamically batch has more than 300 vertices.

batchbreakingcause's People

Contributors

valyard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

batchbreakingcause's Issues

Confused about:Dynamic Batching Disabled to Avoid Z-Fighting

Hi, i have ran this awesome project, but confused about Dynamic Batching Disabled to Avoid Z-Fighting
I have noticed in this scene, two cubes used unlit/color shader, Rendering Path is Deferred. If i changed to standard shader cubes batching success.I wanna to know why or how unlit/color shader caused Z-Fighting.
Thanks for your reply!

Odd Negative Scaling

Not really sure if this is the right place to ask but : Why is negative scaled objects an issue for batching ? Shouldn't it end up in the transform matrix just as anything else ? Especially with instancing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.