public void PassPyramidBuffers(HeightPyramidSegmentShapeGroup @group, ComputeBuffer configurationBuffer, BufferReloaderRootGO bufferReloaderRootGo, ComputeBuffer ePyramidPerFrameConfigurationBuffer)
        {
            group.ETerrainMaterials.ForEach(c =>
            {
                c.SetBuffer("_EPyramidConfigurationBuffer", configurationBuffer);
                bufferReloaderRootGo.RegisterBufferToReload(c, "_EPyramidConfigurationBuffer", configurationBuffer);

                c.SetBuffer("_EPyramidPerFrameConfigurationBuffer", ePyramidPerFrameConfigurationBuffer);
                bufferReloaderRootGo.RegisterBufferToReload(c, "_EPyramidPerFrameConfigurationBuffer", ePyramidPerFrameConfigurationBuffer);
            });
        }
Esempio n. 2
0
        private GameObject CreateDummy(DebugFlatPositionWithEPropPointerAndId dummy)
        {
            var material = new Material(Shader.Find("Custom/EProp/Dummy"));

            material.SetInt("_ScopeLength", _scopeLength);
            material.SetBuffer("_EPropLocaleBuffer", _ePropLocaleBuffer);
            material.SetBuffer("_EPropIdsBuffer", _ePropIdsBuffer);
            _bufferReloaderRootGo.RegisterBufferToReload(material, "_EPropLocaleBuffer", _ePropLocaleBuffer);

            var newGo = GameObject.CreatePrimitive(PrimitiveType.Sphere);

            GameObject.Destroy(newGo.GetComponent <SphereCollider>());
            newGo.AddComponent <BoxCollider>().size = new Vector3(1, 100, 1);
            newGo.GetComponent <MeshFilter>().mesh  = _dummyMesh;
            newGo.GetComponent <MeshRenderer>().allowOcclusionWhenDynamic = false;
            newGo.GetComponent <MeshRenderer>().material = material;
            newGo.transform.position   = new Vector3(dummy.FlatPosition.x, 0, dummy.FlatPosition.y);
            newGo.transform.localScale = new Vector3(2, 2, 2);

            SetIdAndLocaleIndexes(newGo, dummy.PointerWithId);
            return(newGo);
        }