Jump to content
  • Advertisement
Sign in to follow this  
FeverGames

XNA Compile Effect without the content loader

This topic is 3417 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, does anyone know how I can compile an effect in XNA without using the content loader? The effect file is opened as a stream and from that point on i want to compile it to be used on xbox and/or windows. And i want this with methods supported on the Xbox, so no FromFile(); stuff ;-) Anyone?

Share this post


Link to post
Share on other sites
Advertisement
On Windows, you can use Effect.CompileEffectFromFile or Effect.CompileEffectFromSource to compile effects during runtime.

The FX compiler doesn't exist on the Xbox 360, however, so these and any other methods of compiling effects at runtime will only work on Windows. The only way to compile effects for the Xbox 360 is to build them as content and deploy the compiled effects with your game (loading them in through a ContentManager).

Share this post


Link to post
Share on other sites
There's no way to compile an Effect on 360...it doesn't have the required assemblies. What you have to do is compile the effect ahead of time on the PC, using Effect.CompileEffectFromFile to get a CompiledEffect, from which you can get the raw byte[] representing the compiled data. Then on the 360 you can pass that data to the Effect constructor to get an instance of that Effect. This is more or less what the Importer and Processor does in the Content Pipeline.

Share this post


Link to post
Share on other sites
there is no way to compile it with XNA on the xbox?? what if the file itself is precompiled into byte code or anything similar, still no possibility? these xna boys are starting to be a real pain in the ***! :) thanks for the reply though.

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
There's no way to compile an Effect on 360...it doesn't have the required assemblies. What you have to do is compile the effect ahead of time on the PC, using Effect.CompileEffectFromFile to get a CompiledEffect, from which you can get the raw byte[] representing the compiled data. Then on the 360 you can pass that data to the Effect constructor to get an instance of that Effect. This is more or less what the Importer and Processor does in the Content Pipeline.


sorry there i didn't see your reply yet because you replied while i was replying!

thanks for that info! that sounds more like it! :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!