| Topic: Path to effects.fx
|
|
 | Path to effects.fx | |  |
| Poster | : PinQ | | Posts | : 1 | | Country | : Denmark | | City | : Aalborg |
| | | | Posted by PinQ on 26/01/2007 at 07:46:14
| | Thanks for your nice tutorials.
I have suggestion to make deployment easier:
1. Copy the effects.fx file to the source directory as described in the tutorial
2. Add the file to the project
(right-click project / Add / Existing Item / select the file)
3. In the Properties window: Set the 'Copy to Output Directory' to 'Copy always' or 'Copy if newer'
(In the Solution Explorer: right-click effects.fx / Properties)
Then the file is copied to the execution directory when building til project.
The line where the effects.fx is loaded have to be changed to:
CompiledEffect compiledEffect = Effect.CompileEffectFromFile("effects.fx", null, null, CompilerOptions.None, TargetPlatform.Windows);
|
I know that this concerns Visual Studio than XNA, but it is little thing to do, and a better habit.
Regards,
PeterQ
| |
|
| | | | | | Poster | : riemer | | Posts | : 1388 | | Country | : Belgium | | City | : Antwerp |
| | | | Posted by riemer on 26/01/2007 at 09:48:24
| | Thanks, didn't know that option yet.
Anyway, in the DirectX version, I put the resource files in the Debug map, so I also don't have to put the ../../../ thing. In XNA, you should import effect files using the content importer, much like you would import images, as it's done in the second series. | |
|
| | | | | | Poster | : devlinse | | Posts | : 1 | | Country | : ph | | City | : bats |
| | | | Posted by devlinse on 08/05/2007 at 23:14:26
| | I don't know what the difference is but after adding the effects.fx file to the Solution Explorer you can also use this code:
effect = content.Load<Effect>(@"effects");
|
instead of :
CompiledEffect compiledEffect = Effect.CompileEffectFromFile("@/../../../../effects.fx", null, null, CompilerOptions.None, TargetPlatform.Windows);
effect = new Effect(graphics.GraphicsDevice, compiledEffect.GetEffectCode(), CompilerOptions.None, null);
|
| |
|
|
 | | |  |
|
|
|
If you appreciate the amount of time I spend creating and updating these pages, feel free to donate -- any amount is welcome !
|
- Website design & DirectX code : Riemer Grootjans - ©2006 Riemer Grootjans
|
|