Help needed: have a problem with custom RTX shader plugin

Hi,

I have tried to follow a tutorial to create a custom shader RTX plugin for unreal.
I have a problem with function FRayTracingScene::GetLayerSRVChecked that is not documented.
The member LayerSRVs has 0 elements and the plugin crashes with assert.
I think there is some configuration or code line that is missing from the plugin although I think I followed the tutorial instructions.

Thanks!

I’m using UE5.2
Link to tutorial: How to Create a Custom Ray Tracing Shader as a Plugin

Link to the plugin I’ve built following the tutorial: https://github.com/tamiroff/CustomShaders

Screenshots of the problem:




1 Like

@YamWR450F
You probably already did this, but please make sure RT is enable in your project.

Ok so my main suspect would be the test runner which calls for BeginRendering()
I’ve found that a slight delay might be needed in order to make sure everything was set by the scene. I have a rather powerful PC so it might be faster for me.
On the ATestRunner::Tick() try to increase the delay. In my guide the delay was hardcoded to 1.0f like so:

if(RenderTarget != nullptr && TranscurredTime>1.0f)

If that does not work, please write back and I’ll further investigate.

1 Like

Hi FluffyBunnyO,

I’ve validated that RT is on, and the delay code exists (like in your tutorial)
It seams there is a missing code in some of the files that does not include in your tutorial and I guessed what should be in them.

I’ve posted github code of the plugin as close as I managed to do according to your tutorial.
Could you try to run it and identify what is missing?

Link to github code: GitHub - tamiroff/CustomShaders

Thank you very much!
Tamir.

Ok so I cloned your repo and added it as a plugin and I did get the crash you mentioned.
I’ve managed to resolved this by enabling the following project settings:
Engine->Rendering->Hardware Ray Tracing->Ray Traced Shadows
Engine->Rendering->Hardware Ray Tracing->Ray Traced Skylight

Let me know if it works for you :grin:

2 Likes

Hi,

I clone the repo and changed the settings and it works now, thank you very much !

Hey @YamWR450F!

Just checking to see if FluffyBunnyO’s last post worked for you! Let us know by marking the solution, so we can close this up! :slight_smile:

Hi FluffyBunnyO
Your solution works.
Thanks a lot!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.