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

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…