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

Effects in custom files.

Last post 10/8/2009 10:47 AM by nop. 1 replies.
  • 10/7/2009 10:18 PM

    Effects in custom files.

    Is it possible to load an effect from a .fx file in a content processor and then write that loaded effect out to a xnb?

    Thanks
  • 10/8/2009 10:47 AM In reply to
    • (71)
    • premium membership
    • Posts 69

    Re: Effects in custom files.

    Yes.

    Call Effect.CompileEffectFrom* with whatever source you have in your ContentProcessor (be sure to pass the TargetPlatform value you get from the ContentProcessorContext). Write the result out using ContentWriter.WriteObject<CompiledEffect> and load it up with ContentReader.ReadObject<Effect>.
Page 1 of 1 (2 items) Previous Next