I couldn’t find a way to access custom USH file function from the material editor (on a custom node), do you have any idea on how to go about that?
From a custom node you can expose a function inside a ush file just by making a call inside custom node using the parameters you replicate in your custom node to receive input from the material editor.
I don’t understand what you mean, but maybe my question wasn’t clear enough. To be more specific, I created a function called PseudoVolumeTextureEDITED(…) in a .ush file, which I wish to store inside my project folder . Now I want to call this function in my custom node, inside material editor, instead of the original PseudoVolumeTexture that’s stored in the engine’s common.ush file. I saw the link you recommended to create shaders inside a plugin folder , but I couldn’t figure it out how to use function from a .ush file that would be inside this folder from the material editor’s custom node. Thanks in advance!
In that link, it teaches how to create a global shader plugin where you have macros inside the C++ code to publish(implement) the contents of a USF or USH file. Without that you can’t have a function made public to use in a custom node like the original PseudoVolumeTexture was in common.ush. This behavior is necessary since 4.17, before that you could just place a USH file inside the engine shader folder.
Ok, gonna try again! Thanks!
Found this documentation (links changed since the whole section is under reconstruction): Creating a New Global Shader as a Plugin in Unreal Engine | Unreal Engine 5.3 Documentation in these pages you will find the LensDistortion plugin which comes with each Unreal Engine release (full source code in the installation folders) and is also a good start point in understanding what changes in shader development from one new release to the next.
Join my discord channel, we can talk there and if you want in our native language.
Check out my work in this thread, currently it’s very hacky, eventually we’re aiming for actual 3DTexture support in editor, but that is haaaard.
Hey guys I know this is a pretty old forum but I was hoping someone had finished the jfa setup for skeletal meshes. I have attempted to implement the distance field generation from Ryan’s page on shaderbits but I’m having trouble getting the node set up right. I cant seem to get it set so that it evaluates a mesh and returns a volume.
Hey guys, I am struggling to find how to do the “Cutting” visualization logic. Basically I am using Ryan Brucks “Raymarching” custom node to visualize some MRI scan data with a volume texture (which works perfectly). And because I am not in that good understanding in HLSL shader language, so I dont know how to cut the “steps” generated by the volume texture.
After reading the whole thread there wasn’t any mention about the “Cutting” technique which leads to the logic that its probably very simple to implement node wise or code wise.
For the cutting I am just using a WorldPosition>SubtractZ (see ss) which I thought will work, but I dont get the result I want to see.
Any suggestions about how I can do this?
You need to include some lines inside the Density Raymarch and add two extra parameters to it. Hope the file attached helps.
@NilsonLima Thank you very much for the answer! Could you tell me the names of the two extra parameters if possible? I am still in the beginning of HLSL programming, so its very difficult for me to understand what is going on.
SliceNr and SliceRange
The 1st is the slice per say, so a float value from 0-1 representing the slice which is 1 / XYFrames * XYFrames, which in your case for a 88 volume is 64, so each 0.015625 represents a step for each slice, so slice 0 is 0, slice 1 is 0.015625. The 2nd is the thickness you want for the slice, so you can vary it so the slice will can be better visualized and it is important for a large number of slices like 1616 or 20*20.
I thought the parameters were exactly the same as you wrote, but the material gets broken (it shows the default grid material) which by my current experience means there is something with the code itself or? There is no error message too.
Maybe your material differs from mine. Can you send a copy for me attached in the response?
Its exactly the same as the screenshot I posted early. I couldnt manage to attach the .uasset files, so I uploaded them on google drive “link is removed”.
The long name asset is the material and the unprofessional asset name is the texture.
You need to send the original material before you pasted that code I have sent to you.
Nevermind, got what is going wrong. Your material didn’t have the distance fields part, so I have just removed it. Follow the correct code for you to replace.
To see the whole image you just set SliceNr = 0 and SliceRange = 1.0
Anyway, just in case the code has more things than necessary you just compare the two (your original and this one) and add those “ifs” which are the only things added.
Thank you very much for the help @NilsonLima. Now its working as expected!
Is there any way to make this HLSL work in PS4? Mine works fine on PC but not work on PS4 After package