New HDRP template + DOTS

The goal: To extend the 2020.2 HDRP template scene with DOTS for game logic.

The reality: One will need to sacrifice parts of the template scene that are incompatible with the current DOTS packages. For example, Hybrid Renderer 0.10 doesn’t support Lightmaps.

Issue #4: Enabling Enter Play Mode Settings makes some things super bright.
(can’t upload any more pictures to this post, see thread)

Issue #3: Need an alternative for lightmaps for indirect lighting.
Ideas

  • Wait for lightmap support
  • Use raytracing (SSGI) (and tune the template accordingly)
  • Fake indirect lighting somehow
  • Implement lightmap support yourself

Solved:

Issue #2: The shadows on the ECS cube are pitch black. Solution: Delete the template’s lightmaps.

Issue #2

6655645--760825--upload_2020-12-24_8-20-0.png

The cube on the left is an ECS (subscene) cube. The one on the right is a GameObject cube.

Issue #1: Flickering surfaces. Solution: Enable Hybrid Renderer V2.

Issue #1

Adding a Unity default cube into an ECS Subscene does this:

Seizure warning: Flashing surface artifact

6655645--760822--flickering-artifact.gif

Disabling the template’s reflection probes stops some of the flickering:

The faces that the sun is hitting directly are still flickering.

Disabling the sun stops the flickering completely:

This of course ruins the template.

If this goal is impossible or extremely expensive please stop me.

If you have any tips, please let me know.

Some specs:

  • Unity 2020.2.0f1

  • dots.editor": “0.9.0-preview.1”

  • entities": “0.16.0-preview.21”,

  • jobs": “0.7.0-preview.17”,

  • physics": “0.5.1-preview.2”,

  • rendering.hybrid": “0.10.0-preview.21”,

  • render-pipelines.high-definition": “10.2.2”,

  • Windows 64-bit

  • .NET 4.x

When I scrub through the Frame Debugger, the surface flickers non-deterministically. For example, at step # 388 the cube was white, at 389 black, and when I scrubbed back to 388 the cube was black instead of white.

Step 388: white

Next step: black

Original step is now black

Not even the Frame Debugger can contain this beast.

Despair: Maybe it would be best to build from a blank HDRP template with DOTS.

Hope: Maybe someone will know what to do.

1 Like

I think you need to enable Hybrid Renderer V2. I think that’ll fix it.

1 Like

Silly me :sweat_smile:
It fixed the flickering. Thank you.

6656047--760789--upload_2020-12-24_8-5-32.png

6656047--760792--upload_2020-12-24_8-5-38.png

6656047--760795--upload_2020-12-24_8-6-0.png

The lighting is a bit weird but at least it’s not flickering.

1 Like

If it’s okay I’ll keep posting little issues here that relate to the goal.

Going to further clarify the lighting weirdness:

Subscene open:

6656059--760807--upload_2020-12-24_8-12-52.png

6656059--760798--upload_2020-12-24_8-12-10.png

Subscene closed (or in play mode):

6656059--760810--upload_2020-12-24_8-13-15.png

6656059--760819--upload_2020-12-24_8-14-3.png

Shadows on the ECS cube casted by other objects are also pitch black:

6656059--760846--upload_2020-12-24_8-30-56.png

2 Likes

Unsurprisingly, regenerating the lighting didn’t do anything, because the Hybrid Renderer doesn’t support lightmaps yet.

6656149--760861--upload_2020-12-24_8-46-41.png

6656149--760864--upload_2020-12-24_8-46-58.png

6656149--760867--upload_2020-12-24_8-47-6.png


More images of issue #2:

6656149--760876--upload_2020-12-24_8-50-38.png

6656149--760873--upload_2020-12-24_8-50-29.png

Deleting the template’s lightmaps seems to solve issue #2, though now the template will have lighting issues that need to be solved:

ECS cube behaving better:

The template behaving worse:

Maybe Screen Space Global Illumination could replace lightmaps until they’re supported in DOTS.

Screen Space Global Illumination doesn’t seem to do anything in this case, but maybe I’m doing it wrong:

Settings I used:

6656224--760930--upload_2020-12-24_9-17-53.png

6656224--760933--upload_2020-12-24_9-18-25.png

SSGI on:

SSGI off:

Raytracing helps but it’s a special kind of expensive:

SSGI on, via raytracing:

Settings

6656392--760960--upload_2020-12-24_10-23-9.png

SSGI on, “not via raytracing” (I’m confused here but I unchecked the box and it did something):

Settings

6656392--760963--upload_2020-12-24_10-23-47.png

SSGI completely off:

(notice the plants)

AFAIK it’s a known issue that lighting with hybrid renderer is kinda broken right now, both in URP and HDRP. Not to say it isn’t valuable to have the issues clearly documented though. Just don’t expect a fix any time soon - it’s been bad for a while.

Roger that. Thanks for the heads up.

The template seems to have been tuned with lightmaps in mind. Using raytracing would require some counter-tuning.

Raytracing without counter-tuning:
6656446--760996--upload_2020-12-24_10-55-58.jpg

Lightmaps:
6656446--760978--upload_2020-12-24_10-42-27.jpg

Issue #4: Enabling Enter Play Mode Options ( for the speed bonus ) makes some things super bright.

6656470--761002--upload_2020-12-24_10-59-17.png


6656470--761005--upload_2020-12-24_10-59-31.png

1 Like