Can I add geometry to a mesh in a Content Processor?

I would like to use the existing FBX importer, but process the model mesh in a Custom Content Processor to add an additional layer of geometry (fur polygons, in this case) to the model’s vertex and index buffers.

Is this possible? I know I can add vertices during runtime, but that would potentially increase loading times. I’d much rather do it at compile time in a processor. That is pretty much what content processors are for, after all.

I’m asking because my own experimentation on the subject has proven less than successful and I’ve been unable to find a custom content processor tutorial that deals with problems of this nature online.

Thanks,
Quasar

I cant see why not, however the last content processor I wrote was for XNA, things may be a little different in MG. If I get time today ill have a look and let you know how I get on :slight_smile:

OK, it can be done, but it would involve me reflecting the base library to do it. I am not sure that would be the right thing to do as it’s not my code base.

What would be much better, is if the MG pipeline classes were not an exact copy of the XNA ones, that is to say, all the private members being made protected, all the underlying methods being made virtual. This would make the pipeline tool a lot more flexible and usable…

I would imagine this has been raised before and it has either not been done for legal reasons, or no one has been able to get enough time on it yet…

Sorry I could not be of more help, and I may be wrong, there maybe someone here with a better idea of how to do this…

Well, that’s unfortunate. I thought I could offload a whole bunch of repetitive, procedural tasks I’m currently doing in my 3d environment to a custom processor, but not being able to add new mesh geometry throws a spanner into that idea. I was hoping I was just missing something obvious.

I guess I’ll mark this one down as requiring a deep dive into the Monogame source code. I’ve been wary of doing that since I don’t feel entirely comfortable with the behind-the-scenes stuff in Monogame, but needs must.

Thanks for taking a look. Are there any tips or code samples you can offer to keep me out of trouble?

I might fork the repo and see if I can start opening it up, I dare say someone may have already tried this and found a blocker in there somewhere, but I might give it a go anyway. If I get it done I can then make a pull request and it might go into the main branch one day :slight_smile:

To be honest, it’s something I enjoy doing, I do it at work a fair bit lol

Tips and code samples on what? The content pipeline? What I have done in the past is append my own data structure to the content pipeline. So I have a dll that holds my data extension class, this is then accessible from both the content pipeline dll and my game. Like this:

In the content processor I then just populate my data structure and throw it in the ModelContent.Tag property. Like this:

Then in my game I can access it like this:

In this instance I am using a Dictionary to store the data, looking back at this old code, a container class might be a better way to do it :stuck_out_tongue: