Convert 2D material to a 3D "object"?

I am playing with some fractals…

Now I can make a 2D material, that displays the fractal using custom HLSL shader.
The fractal is “3D” ish. Of course, displayed on a 2D material.

Is there a way to make it into a 3D “object” in the scene?
Hope question makes sense.

For example…
This is just a made up example…but it is similar.
Say I have a shader that displays the solar system and planets rotating around the sun.
I can create a custom HLSL node and make a material that displays it.
But it is being displayed on a 2D surface.
How do I make it so it exists in the 3D world of the scene itself?
So that I can have my character walk around it?

Inform yourself about normal maps, height maps, bump maps and tesselation. This could help.

Calculate a offset in world space and wire it into World Position Offset.

Height maps and bump maps won’t work for what I’m after.

Modifying World Position Offset, will change the position of the whole surface/mesh.

Another example…
Say I have a shader…
It displays a 3D cube, the cube morphs back and forth between a 3D cube and a 3D sphere.
Now I can make a custom HLSL shader/material, with that shader.
It will display the object morphing back and forth between cube/sphere on the 2D surface (if it’s a plane).

I want the shader to display this effect in the 3D space of the scene…

Look into “procedural generation” of meshes, there’s an example in the Content Examples iirc. You can write C++ code or draw Blueprints that create model geometry you can place as static meshes within levels and walk around etc Procedural Mesh | Unreal Engine Documentation

Very basic example which just creates a single triangle Jan Wlosok | Procedural Mesh in UE4 #1 – Triangle
…then like, add more triangles to create your menger sponge or snowflake mandelbulb or whatever

I have heard of procedural meshes…etc…but that is a whole other beast.
I will eventually look into that for other stuff.

Here is an example shader I got working in Unreal

It’s very nice looking, I made a material of it.

It is animated, not just an image…of writhing “tentacles”.
It’s a material on a cube object…

I don’t think this could be ported and made a procedural mesh.
That is, without starting completely from scratch, not using a shader at all.

What would be cool…
Is to make those writhing tentacles a 3D entity(not a mesh per say) in the scene…
This seems to a more difficult task than I thought it would be.

I think you might be able to do that using the Niagara particle system, it’s meant for making like lightning bolts or fog clouds or swarms of insects out of lots of flat semitransparent images laid on top of each other.

Here is what my imaginary process would look like…
Whether needing to use a particle system or not, is another issue…probably it would be needed.

Have two materials

  1. One HLSL material, that simply creates the “3D entity” (contains pixel colors)
  2. Uses shader in #1 but outputs not a color, but the z-buffer information.
  3. Use the pixel color values in #1, and the z-buffer values in #2, to create a 3D entity in the scene.
    Perhaps create tiny sprite particles from #3 to create the 3D entity.

Now I don’t know if HLSL shaders in general use a z-value.
So if you are computing the color at pixel.xyz, you might not even use a z value.

This sounds exactly like what I’m looking for, but it is in Unity3D.

https://www.alanzucconi.com/2016/07/01/volumetric-rendering/