HTrace: World Space Global Illumination [RELEASED]

HTrace: World Space Global Illumination

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

HTrace WSGI is a fully dynamic software ray-tracing system for rendering diffuse indirect lighting with infinite light bounces. It 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.

Useful Links:

Main Features:

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

Dynamic Lighting and Objects: HTrace WSGI 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.

Advanced Denoising: HTrace WSGI 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.

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.

Punctual Lights: HTrace WSGI supports Point and Spot light sources, fully accounting for their emission and shadows.

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.

GPU Instancing: HTrace WSGI supports instancing through RenderX functions as well as native instancing for Terrain Trees, and Terrain Details, enabling fast voxelization of dense environments and rich vegetation. Examples and documentation for custom instancing shaders are provided.

VR Support: Single Pass VR is supported (experimental).

Open Code: the code is open for modification. If you have questions about how it works, feel free to reach out to us on Discord.






10 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

2 Likes

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!

6 Likes

Hey. Do I have to repurchase the asset if I have H-Trace?

“You will own nothing and be happy about it.”

If you own the previous version, you can upgrade to the new one for a fixed $15 upgrade fee.
For more details, please refer to the announcement posts:

The upgrade discount is applied automatically and should be visible in the Asset Store, provided you’re logged in with the same profile used to purchase the previous version.

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

New Features:

  • General instancing support (RenderX functions) added
  • Trees & Details instancing support added
  • Terrain instancing support added
  • Explicit LOD control added
  • Drawcall reduction through optimized state changes
  • “Scene Camera Follow” option added
  • HTrace Light Tag for custom shaders added

Changes / Fixes:

  • APV Fallback error when APV is unavailable fixed
  • Sky occlusion out of bounds sampling fixed
  • First frame errors on voxelization mode switching fixed
  • Voxelization passes compacted to a single pass
  • Debug dropdown moved to a separate Debug section
  • Native shadowcaster pass is used by default
  • LOD modes dropdown is removed
  • Sample Cornell Box scene updated with terrain


4 Likes

Hello
I don’t know if you’ve noticed, but these delicate objects can bring strange shadows, such as fences standing against walls or utility poles.


Even if they are far away, objects blocking the camera will leave incorrect shadows on objects behind

Is it because I didn’t fix something?

debug mode

Hi!

These are shadows cast by screen-space rays. Potential reasons are:

  1. The camera being outside the voxelization volume
  2. The objects being outside the voxelization volume

This can be explained by reason №2 mentioned above. The voxelization volume has spatial limits, and some objects inevitably fall outside of it. These objects will fall back to screen-space rays, which treat them as if they have infinite thickness, leading to such shadows. However, in your second screenshot, the distance to these objects looks rather small, so I doubt this is the case.

Check the voxelization debug views, make sure that these objects are properly voxelized if possible. Refer to this section of the documentation for more information: Voxelization | HTrace World Space Global Illumination

Here’s a useful thread where I showed different ways to expand GI and voxelization to big distances, you’ll probably find it useful: Discord

If none of this helps, let me know, and I’ll investigate further!