//获取Facet渲染层级 public void GetFacetRenderLayer(out FFacetRenderLayer renderLayer, out int firstFacetIndex, FFacetType facetType, FAtlas atlas, FShader shader, int numberOfFacetsNeeded) { int batchIndex = facetType.index * 10000000 + atlas.index * 10000 + shader.index; if (_topLayer == null) { _topLayer = CreateFacetRenderLayer(facetType, batchIndex, atlas, shader); _topLayer.Open(); } else { if (_topLayer.batchIndex != batchIndex) //we're changing layers! { _topLayer.Close(); //close the old layer _topLayer = CreateFacetRenderLayer(facetType, batchIndex, atlas, shader); _topLayer.Open(); //open the new layer } } renderLayer = _topLayer; firstFacetIndex = _topLayer.GetNextFacetIndex(numberOfFacetsNeeded); }
public void GetFacetRenderLayer(out FFacetRenderLayer renderLayer, out int firstFacetIndex, FFacetType facetType, FAtlas atlas, FShader shader, int numberOfFacetsNeeded) { int batchIndex = facetType.index*10000000 + atlas.index*10000 + shader.index; if(_topLayer == null) { _topLayer = CreateFacetRenderLayer(facetType, batchIndex, atlas, shader); _topLayer.Open(); } else { if(_topLayer.batchIndex != batchIndex) //we're changing layers! { _topLayer.Close(); //close the old layer _topLayer = CreateFacetRenderLayer(facetType, batchIndex, atlas, shader); _topLayer.Open(); //open the new layer } } renderLayer = _topLayer; firstFacetIndex = _topLayer.GetNextFacetIndex(numberOfFacetsNeeded); }