As you can see from this video, the shader graph was used to curve the path. In landscape mode, it works as expected but in portrait mode nearby objects (the buildings and other objects) disappear from view.
They are not getting destroyed, they still exist in the scene, but disappearing from view abruptly. How do I stop this from happening?
I have tried this with different implementations of shader graphs, but the same problem exists with all. Shader graphs tried:
Also note that I am completely inexperienced with Shader Graphs and I was following Udemy and Youtube tutorials.
Using provided solution like this:
private void SpawnBuildings(GameObject itBlock)
{
foreach (var i in buildingSpawnPoints)
{
Vector3 buildingSpawnLocation = itBlock.transform.position + (i.position - startingPoint.position);
int rotationOffsetBy90 = Random.Range(0, 3);
Quaternion buildingSpawnRotation = Quaternion.Euler(0, rotationOffsetBy90 * 90, 0);
Vector3 buildingSpawnSize = Vector3.one * Random.Range(buildingSpawnScaleRange.x, buildingSpawnScaleRange.y);
int buildingPick = Random.Range(0, buildings.Length);
GameObject newBuilding = Instantiate(buildings[buildingPick], buildingSpawnLocation, buildingSpawnRotation, itBlock.transform);
newBuilding.transform.localScale = buildingSpawnSize;
// Fustrum culling
Mesh mesh = newBuilding.GetComponent<MeshFilter>().mesh;
mesh.bounds = new Bounds(newBuilding.transform.localPosition, buildingSpawnSize);
// Vector3.one instead of buildingSpawnSize causes it to render similarly
}
}
causes the same culling. Using the above causes it to be rendered as shown here. It's not culling the buildings on the sides near the edge of the screen but it's culling those at a distance.


OnPreCull()fromStart()to make it work. Is this an acceptable solution (the second one), or is it problematic and would cause unintended consequences? Thanks. \$\endgroup\$