XNA Creators Club Online
Page 1 of 1 (8 items)
Sort Posts: Previous Next

FBX... What the?

Last post 10/19/2009 8:54 PM by jwatte. 7 replies.
  • 10/12/2009 3:44 PM

    FBX... What the?

    To start with the problem, I've integrated the PerPixelLighting shader posted in the ressource in here.

    My first problem I found was that the shader wasn't made to display the texture of the FBX.

    So, I modified the .FX to do just that.
    But now my mesh isn't displaying the correct texture.

    So, I want to access the pointer to the texture/material inside the FBX and manually change it to the right one.
    (Maybe in the same process create myself a real Material class so I could switch material at will on meshes and do stuff like multi-layer and effect control per material instead of per model)

    But I can't seam to find that.

    I've read stuff about Opaque Data... So yeah, currently it's pretty damn opaque.
  • 10/12/2009 4:34 PM In reply to

    Re: FBX... What the?

    The BasicEffect already supports per-pixel lighting; just turn on the feature.

    If you want to use your own shader, the best thing you can do is to build the content with the shader from the beginning in your content creation program. That way, there's no question of what the parameters should be.

    If you can't do that, then you need to get the Texture from each Basic Effect instance, and re-apply that Texture to the appropriate EffectParameter of the new shader you apply.

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 10/12/2009 5:32 PM In reply to

    Re: FBX... What the?

    jwatte:
    If you want to use your own shader, the best thing you can do is to build the content with the shader from the beginning in your content creation program. That way, there's no question of what the parameters should be.


    More info here and here.


    jwatte:
    If you can't do that, then you need to get the Texture from each Basic Effect instance, and re-apply that Texture to the appropriate EffectParameter of the new shader you apply.


    An example of this technique.
    XNA Framework Developer - blog - homepage
  • 10/12/2009 6:07 PM In reply to

    Re: FBX... What the?

    Shawn Hargreaves:
    jwatte:
    If you want to use your own shader, the best thing you can do is to build the content with the shader from the beginning in your content creation program. That way, there's no question of what the parameters should be.


    More info here and here.


    jwatte:
    If you can't do that, then you need to get the Texture from each Basic Effect instance, and re-apply that Texture to the appropriate EffectParameter of the new shader you apply.


    An example of this technique.


    Thanks, checking this. :)
  • 10/13/2009 2:40 AM In reply to

    Re: FBX... What the?

    Checked all the stuff...
    I'm far from being pro in that, and it's maybe I don't understand stuff.

    But from what I understand, once the content went on that pipeline, you don't have access to it anymore, right?
    While it's interesting to make your own Content Processor, once it's done, it sounds quite hard to change it on runtime.
    On top, unless you do something with naming convention and stuff, all your model will go in the same content processor, right?

    How do you do if you want part of one mesh to have one shader while other part has another?
    A huge .FX that hold all the possible combination?

    Sorry, I'm used to work with engine that let me do whatever I want with my material and texture.
    Any number of layers I want, turn them on/off on runtime, change layer or change whole material.
    Add FX, scale, scroll, rotation, after effect and so on...

    Does Content Processor let me do all that easily and I'm just not seeing it or understanding it?
  • 10/13/2009 3:53 PM In reply to

    Re: FBX... What the?

    It's entirely up to you whether you want to do this tweaking in a content processor or at runtime. Personally I recommend doing it in a processor (because that is usually easier and more efficient) but it works fine in either place. It's all just code at the end of the day, and it's up to you where you prefer to put this code.

    The XNA Framework is lower level than the engines it sounds like you are familiar with, so it doesn't really have a built in concept of things like "material" or "layers". All drawing is done using shaders, but it is up to you to write whatever shaders you want to use. Flexible material systems can be created either by choosing between a library of different shaders, or by making one more powerful shader that has a bunch of parameters to adjust how it behaves.
    XNA Framework Developer - blog - homepage
  • 10/14/2009 3:56 AM In reply to

    Re: FBX... What the?

    Shawn Hargreaves:
    It's entirely up to you whether you want to do this tweaking in a content processor or at runtime. Personally I recommend doing it in a processor (because that is usually easier and more efficient) but it works fine in either place. It's all just code at the end of the day, and it's up to you where you prefer to put this code.

    The XNA Framework is lower level than the engines it sounds like you are familiar with, so it doesn't really have a built in concept of things like "material" or "layers". All drawing is done using shaders, but it is up to you to write whatever shaders you want to use. Flexible material systems can be created either by choosing between a library of different shaders, or by making one more powerful shader that has a bunch of parameters to adjust how it behaves.

    Thanks, I was just wondering if I wasn't missing something totally obvious... Like it happens so often.
  • 10/19/2009 8:54 PM In reply to

    Re: FBX... What the?


    you don't have access to it anymore, right?


    You have access to the data inside the processing pipeline by writing your own processor.
    You have access to the data written out by the processing pipeline when you do ContentManager.Load<YourContentType>().
    You can change the data in whatever way you want (assuming the classes involved have functions/properties to change the data, of course :-)
    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
Page 1 of 1 (8 items) Previous Next