HTrace: World Space Global Illumination [RELEASED]

HTrace: World Space Global Illumination

Grab your copy on the Asset Store and join our Discord and Twitter to get more news about upcoming features and updates!

Support us on Patreon and get access to our internal roadmap, discussion and latest WIP features!

HTrace is a fully dynamic software ray-tracing system for rendering diffuse indirect lighting with infinite light bounces.

HTrace doesn’t require any kind of baking or asset pre-processing and is designed to work out of the box with little to no tweaking.

Sponza Demo can be downloaded here.
Documentation is available here.

MAIN FEATURES:

- Full Integration into the Rendering Pipeline: automatic resource injection that doesn’t require manual setup or package customization. HTrace overrides native indirect lighting resources, ensuring compatibility with other rendering effects.

- Dynamic Lighting and Objects: HTrace supports fully dynamic environments where objects, materials, and lighting can be changed in real time. All moving objects, including skinned meshes, participate fully in global illumination, casting and receiving indirect lighting and shadows.

- Hybrid Software Ray Tracing: a two-stage tracing algorithm that leverages both screen-space and world-space data to deliver per-pixel lighting response and accurate indirect shadows. No special hardware is required.

- Real-Time Scene Voxelization: a flexible, GPU-driven voxelization system for building a world-space tracing acceleration structure on the fly. Comes with an advanced time-sliced voxelization, adaptive culling & mesh LOD control.

- Irradiance Cache: provides infinite light bounces in world-space by automatically caching lighting data in a spatial hash structure.

- Emissive Lights: all emissive surfaces can act as real light sources, casting indirect shadows and contributing fully to global illumination. There’s no upper limit on the number of emissive lights.

- Sky Lighting & Occlusion: the sky itself functions as a dynamic light source, producing realistic lighting and physically accurate occlusion.

- APV Support : Unity’s Adaptive Probe Volumes are automatically utilized as a ray-miss fallback, ensuring a smooth transition between HTrace lighting and APV data. Additionally, APV can be used to accelerate multi-bounce light calculations.

- Advanced Denoising: HTrace uses cutting-edge denoising and sampling techniques, like ReSTIR GI, with temporal and spatial passes to reduce noise even in complex lighting scenarios. Special care is taken to preserve high-frequency details such as contact shadows and normals.

- Open Code: feel free to modify it. If you have any questions on how any part of it works you can always reach out to us on Discord.

9 Likes

Do you have a tutorial to set it up maybe?

Hi! The setup process is described in the documentation: Quick-start manual | HTrace World Space Global Illumination

HTrace: World Space Global Illumination is updated to version 1.1.0 !

New Features:

  • APV Ray Fallback added
  • APV Multibounce option added
  • Emissive Textures support added
  • Multibounce Mode dropdown added

Changes / Fixes:

  • Memory leaks fixed
  • Terrain Culling error in Unity 6.0+ fixed
  • “Property (_GBufferTexture0) at X is not set” error in Forward mode fixed
  • “Temporary render texture not found while executing” warning fixed
  • Other minor fixes and improvements

It’s recommended to delete the previous HTrace package to perform a clean installation of the new version and reload the Unity Editor afterwards.


1 Like

We are working on instancing support for voxelization. With an upcoming update HTrace will support RenderX functions that use instancing.

Here’s an example of a scene voxelized with RenderMeshInstanced

1 Like

I have some issues with 1.1.

When the object is not inside the voxel cube, the shadow goes very dark, and it seems the sky light doesn’w work on the object.


In addition, after the update, I found that it put more pressure on the graphics card. Every time in editing state, the GPU fan will spin crazily, but this was not the case in 1.0.

Hi and thank you for reporting this!

This is a bug indeed and we have a fix ready. It will land with the next update. In the meantime, you can DM me here or in Discord with your invoice and I will send you the replacement file :slightly_smiling_face:

By “editing state” you mean working on your scene in the Scene tab?
To investigate this further, I will need additional information:

  • Unity version
  • HDRP package version
  • API (DX11 or DX12)
  • Weather you have terrain in your scene or not

Thank you!

6000.0.23f1,DX12,GTX2060

Just stay on this interface and do nothing, the graphics card’s fan will increase its RPM
I have already turned off the “always refresh” option in the scene window, but it doesn’t seem to change anything
Strangely, this didn’t happen in version 1.0. I just installed version 1.1 today

Oh, by the way, I tried to reduce the objects in the scene and found that it could improve a bit. The fan won’t turn so fast anymore, which should be related to the complexity of the scene.
But the same thing was not a problem in 1.0. The only problem with 1.0 was that as long as I opened a terrain, the frame rate would decrease. As long as I hid the terrain, everything would be fine
I hope this information can help you


If I delete H-Trace in hierarchy, The graphics card fan will be gentler.
I hope these can provide some information

Understood. What happens if you disable the terrain in the 1.1.0 version or switch it to “Instanced”?
Also, does switching Update Mode to “Partial” help?

Your issue may be related to the terrain, because it wasn’t supported in Unity 6 in 1.0.0 version.

I tried it, but it didn’t work. I suspected it was a problem with the terrain, so I hid it, but it didn’t work.
Changing the update mode to “Partial” also made almost no difference.
Of course, this is not a fatal problem. I can hide the H-trace first, then edit the scene, and then show it when I need to debug the lighting, although this process is a bit strange.

Did you disable it or just hid it?
Hiding it like this:
image
won’t make it disappear from voxelization, unfortunately. You can use debug views to inspect scene voxelization and see if the terrain is removed from it or not. Also, have you tried switching it to Instanced draw mode as I suggested?

Another thing to note is that it’s better to delete the previous version (1.0.0) before installing the new one (1.1.0.) and reloading the editor after that also won’t hurt.

If this doesn’t help I’ll need information from the Profiler to understand what’s going on. Both CPU and GPU usages of everything inside the HTrace voxelization pass (in Constant mode) would be ideal. Alternatively you could zip a repro project and send it to me, so I could take a look myself.

Also, as I previously suggested, you can DM me here or in Discord. At the very least I could send you the previous version which worked for you :upside_down_face:

Yes, I am used to completely hiding an object, using the Alt+Shift+A shortcut.

When I installed 1.1, I used the new function of uninstalling packages in Unity 6.0, and uninstalled it directly in the Package Manager. Later, after discovering the problem, I manually deleted the entire folder and reinstalled it, but it didn’t seem to change anything.

However, it doesn’t matter. I don’t think it’s a big problem. I am more looking forward to solving the bug of the scene turning black first, at least making it look normal.

So, I am looking forward to your next update.

I have joined your Discord group. If I have any questions, I will continue to ask you. Thank you.

1 Like

Our work on instancing support continues. Over the past weeks we have added:

  • Terrain Instancing
  • Terrain Trees Instancing
  • Terrain Details Instancing

Thanks to these features and a bit of batching optimizations we can now voxelize and trace denser scenes. A good example is Book Of The Dead environment where we achieved a huge drawcall reduction.

Instancing support is already available to our Patreon subscribers!

3 Likes