Custom content pipelines in XNA, how to adjust diffuse textures manually?

XNAs are bee's knees, but I still can't completely wrap my head around user content pipelines.

Some basic samples, such as the regular MSDN card sample, show how to assign normal card keys from opaque data from a .fbx file to the corresponding normal card textures for download. I don’t even know how they knew which key should be called, what opaque data actually exists if it is defined in the .fbx file or not.

Interestingly, there is no code in the content pipeline that talks about how diffuse textures are set up, it seems to imply that you are using a shadow parameter called β€œTexture”, and they are automatically installed. But if I rename the parameter to something else, the models will load without textures.

How is it implicitly known for loading blurry textures and how can I, for example, load blurry textures for reading with a different shader parameter name and load a neutral white texture file by default if it does not exist?

In this regard, is there a hello world example for teaching user models to load content pipeline?

Please note that I am not trying to override existing texture references in .fbx models by setting the texture in the properties window.

+5
source share
1 answer

The first thing to understand is that XNA allows you to create two separate elements of the content pipeline: one is the importer, and the other is the processor.

When you write an importer, you analyze any file as you want and save the necessary information in any class (object) you specify. You can write a class yourself or use specific classes in XNA. Thus, you can simply write an importer that takes data from your file and, using the built-in ModelProcessor, does this in an object of the XNA Model class.

Here is an example of a custom model importer:

http://create.msdn.com/en-US/education/catalog/sample/custom_model_importer

- , , :

, , ( , - ). .xnb( XNA), . , , .

:

http://msdn.microsoft.com/en-us/library/bb447754(v=xnagamestudio.20).aspx

, FBX . , , , . , , ; ModelProcessor , , .

+3

All Articles