- Home /
GPU Instancing Help, Performance not expected!
Hello,
Im running Windows 10, Unity 2018.2.15f1, default render pipeline.
Specs:
gtx 1080 (evga) @ +85/+175/+50%/PT: 120%
i7 8700k @ max turbo (5ghz)
850watt psu
32gb ram @ 3200mhz (dual channel)
I have a prefab in Unity 2018.2.15f1:
The prefab has 2 LODs (single objects), which are both a child objects of the main object.
Both LODs have a texture straight applied to it with gpu instancing enabled with specular highlight disabled, reflections disabled, and double sided global disabled.
The model has about 500 vertices at LOD 0 and 100 at LOD 1
Im rendering about 2.6 Million vertices and running at 30fps. I thought this frame rate might have to do with the updating of the objects taking place on multiple threads. Here is the script for the model parent:
using UnityEngine;
public class GS_Fern : MonoBehaviour, IThreadUpdatable {
public GameObject[] Elements;
private bool setEnabled = false;
private bool lastEnabled = false;
private bool change = false;
private Vector3 position = Vector3.zero;
public void threadUpdate(int chunk)
{
bool value = Vector3.Distance(position, Player.playerPosition) < 15;
setEnabled = value;
if (value != lastEnabled)
{
lastEnabled = value;
change = true;
}
}
private void Update()
{
position = transform.position;
if (!change)
return;
foreach (GameObject el in Elements)
{
el.GetComponent<MeshRenderer>().enabled = setEnabled;
}
change = false;
}
}
In the frame analyzer, the "RenderForward.RenderLoopJob" has about 14 thousand calls (all without "(instanced)") (different model with the same thing I described), looking like this:
Also in the frame analyzer, the "DepthPass.Job" has about 140 calls (all with "(instanced)"), witch looks like this:
Is this a problem?
Am I doing anything wrong?
Please help and answer if you can!
Your answer
Follow this Question
Related Questions
How to use Point and Spot Lights With Mesh instancing? 0 Answers
Project moved to Unity 2020 from 2017 using much less ram, less CPU, but performing much worse 0 Answers
Texture Atlas Duplicating Because Of Material Differences? 0 Answers
Difference between dynamic batching and gpu instancing? 1 Answer
When I enable 'GPU Instancing', transparent object starts flickering. 0 Answers