So, I’m new to ECS/HDRP. I’m just getting into it, following some of the more popular tutorials online. I seem to have run into a strange artefacting problem whilst trying to render a few hundred simple planes. The project is a new scene made in the sample HDRP project available in unity (v2019.3.0a5). Below is the script I’m using to create entities from my GameObjects, which are located during the Awake() method of my MonoBehavior script.
public class Bootstrap : MonoBehaviour
{
private Object[] _gameObjects;
private EntityManager _entityManager;
private void Awake()
{
// Assets\Resources\Environment\Temp\
string path = @"Environment\Prefabs\Ground\";
_gameObjects = Resources.LoadAll(path, typeof(GameObject));
}
private void Start()
{
_entityManager = World.Active.EntityManager;
NativeArray<Entity> entities = new NativeArray<Entity>(_gameObjects.Length, Allocator.Temp);
var entityArchetype = _entityManager.CreateArchetype(
typeof(RenderMesh),
typeof(Translation),
typeof(LocalToWorld)
);
_entityManager.CreateEntity(entityArchetype, entities);
for (int i = 0; i < _gameObjects.Length; i++)
{
var entity = entities[i];
var g = _gameObjects[i] as GameObject;
var mesh = g.GetComponent<MeshFilter>().sharedMesh;
var material = g.GetComponent<MeshRenderer>().sharedMaterial;
_entityManager.SetSharedComponentData(entity, new RenderMesh
{
mesh = mesh,
material = material
});
}
entities.Dispose();
}
}
Upon running the game, using the Scene view, everything is normal. I can move around the scene without any problems (normal_viewport.png). When I switch to the camera view, however, everything shows up as black. I have a simple monobehavior script attached that allows me to move my camera around my scene (taken from the HDRP sample scene). The second I move my camera, I’m getting strange artefacting (including the blackness of the objects when I first switch to the Game view, camera_artefacts.png). I assume I’m doing something really wrong, I just don’t know what it is. Any help would be greatly appreciated! If I need to supply any more information please feel free to let me know!

