- Home /
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), $$anonymous$$aya(pay), or 3DS $$anonymous$$ax(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.
Answer by tanoshimi · Nov 12, 2014 at 11:24 PM
If you're targeting DX11, you can use a geometry shader to create primitives: https://takinginitiative.wordpress.com/2011/01/12/directx10-tutorial-9-the-geometry-shader/
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.