Materials & Geometry shaders

The vertex factory defines the inputs of a mesh for a material, ie. Will it need Position, Normals, Texture Coordinates and such and takes care of binding the shaders for rendering the mesh. Each time you compile a material, it creates an instance for each vertex factory type there is, creating the combined vertex, pixel, domain and hull shaders, currently none of the factories provide a geometry shader (But last I saw, there is now code to allow you to bind a geometry shader to a vertex factory, where as you used to have to modify the source to do so). This should all be possible from within a plugin. So you would need to create your own vertex factory (or extend the static mesh one) so you can bind your own geometry shader, and write the appropriate USF. I have done this in the past, with success, but the engine has changed since, I doubt my original version would work anymore, but looking at it, its probably even easier now.

2 Likes