Creating 3D Shapes with shaders

Is it possible to generate a 3d object with shaders?
I’ve been struggling to grasp shaders capabilities.

If so, could you provide an example?

Thank you,

As far as I know shaders only handle how 3D shapes are rendered. If you want to make a 3D model then use something like Blender(free), Maya(pay), or 3DS Max(pay).

–

Thank you,but the plan was to generate a model procedurally.

–

Then I would suggest maybe trying to do it via either C# or js(Unityscript), rather than the shader.

–

1 Answer

1

If you’re targeting DX11, you can use a geometry shader to create primitives: DirectX10 Tutorial 9: The Geometry Shader | Taking Initiative

However, as a general rule, don’t create new objects at the shader stage (certainly not if you intend to interact with them) - model them, or create them programmatically through code.

Thank you, I'm targeting OpenGL so I suppose its a no no.

–