fxo compiler

Posted By: FBL

fxo compiler - 02/12/11 18:15

The integrated shader compiling process appears to be crap.

- it is not clear what needs to be done
- the manual only comes up with:
Quote:

-fxo P A8
Kompiliert alle .fx-Effektdateien. Kompilierte Effekte können die Ladezeit des Levels sowie die Dauer der Materialerstellung deutlich reduzieren. Es werden nur Effekte, die einem sichtbaren Objekt zugewiesen sind, kompiliert. Ersetzen Sie zum Verwenden der kompilierten Effekte. die .fx effect file names in den Materialien durch .fxo

What is this fuzz about assigned to visible objects only? I want to compile my .fx files regardless to how I'm using them!

- it simply does not seem to do anything. And the manual does not really help in finding out what I'm doing obviously wrong
- I don't want to start the project in order to compile .fxo, then re-edit all .fx to .fxo in the scripts and then run the project again. This is major fail in workflow. When I changed some shaders I need to do the whole renaming process again or what?
- why doesn't the engine automatically search for .fxo for any given .fx file and vice versa?

I'm really annoyed right now.
Posted By: Superku

Re: fxo compiler - 02/12/11 18:39

I did not try it, yet, but I thought you could just pre-compile a single effect file.
If not, that's indeed bullshit.
Posted By: rojart

Re: fxo compiler - 02/12/11 20:59

yes, I also had a small problem to get the fxo files, but this way should be work.

Add in SED->Options->Preferences->Command Line Options-> -fxo

Now run your current script as allways once, then the compiler will Compiles all .fx effect from your code files to .fxo files.

Close your Applications and Edit->Replace the .fx effect file names in the .fxo for using the compiled effects and test it again.
Posted By: FBL

Re: fxo compiler - 02/12/11 21:05

Unfortunately this does not work. It seems to be related to the fact, that I create everything dynamically and the fx filename is stored in a char array and not assigned to some entity...

And yes, I'm using the Pro version.
Posted By: FBL

Re: fxo compiler - 02/12/11 21:14

Ah... it DOES compile... it just doesn't place the fxo file in the same location as the original fx file.


WHY
DO I
ALWAYS
HAVE
TO COPY
THINGS
AROUND
MAUALLY
!?

This is soooooooooooooo annoying.
Posted By: rojart

Re: fxo compiler - 02/12/11 21:21

Hmm strange, my fx and fxo files are in the same folder as my app.c too.

As example try to compile the fxo files with shadowmapping.c app from sample folder, it should compile in the same folder.
Posted By: FBL

Re: fxo compiler - 02/12/11 21:27

I'm using add_folder(), that's probably the reason.
Posted By: FBL

Re: fxo compiler - 02/12/11 21:42

So the right way to do it is this:

- add -fxo in SED preferences
- run script one time, exit right away
- replace .fx with .fxo in all your scripts
- copy all .fxo files from the project root to the appropriate subfolders
- before starting again make sure to remove -fxo from SED preferences unless you want to read many many weird warnings
- if you need to change a shader replace .fxo with .fx in all your scripts
- repeat all the steps above

- cry because of the non existent workflow


Posted By: Tobias

Re: fxo compiler - 02/24/11 13:14

I compile shaders all the time but never had the idea to replace .fx with .fxo in all scripts or to copy all fxo files to subfolders. The engine knows anyways if its an .fx or .fxo file to load, so why want you to replace all the names in the script?

Quote:
P If a precompiled effect (*.fxo) exists and is newer than the effect file (*.fx) from the material definition, the precompiled effect will be loaded. This will speed up material loading. It also makes it unnecessary to include the shader compiler (d3dcompiler_42.dll) in the published version when precompiled effects are included instead.

The only thing you really need is your step 1. Of course you can also do all the other steps, but I dont think its required for the script, its more a personal hobby then grin.

Shader compiling is highly recommended, it not only loads faster but your shader code is then protected, users cant decompile it. Otherwise even when you use WRS, the shader code can theoretically be ripped with a memory tool.
Posted By: FBL

Re: fxo compiler - 02/24/11 16:32

Where did you get this from?

That's what my manual says:

Quote:

Kompiliert alle .fx-Effektdateien. Kompilierte Effekte können die Ladezeit des Levels sowie die Dauer der Materialerstellung deutlich reduzieren. Es werden nur Effekte, die einem sichtbaren Objekt zugewiesen sind, kompiliert. Ersetzen Sie zum Verwenden der kompilierten Effekte. die .fx effect file names in den Materialien durch .fxo



..and that's exactly what I had to do in order to get it to work... besides copying everything in place, since the compiled files were put to the project root, not to the folder where the original .x resides.

This folder issue was the main cause for all the trouble, as I kept looking at the fx file and expected a fxo file pop up next to it...

Still, workflow = terrible.
Posted By: Tobias

Re: fxo compiler - 02/24/11 16:38

Its under "effect".

http://manual.3dgamestudio.net/Shader-effect.htm

I only have the english manual, for good reason, the german manual is often outdated.

The .fxo files dont pop next to the .fx file, they are created in the project folder, where you main script is. This sort of makes sense because files in that folder override files in subfolders.

I'm not sure what you mean with workflow, its your thing how you organize your work. Typing a "-fxo" in the command line, what has this to do with workflow? Many can be said about bad workflow, but I dont see a relation to the shader compiler.
Posted By: FBL

Re: fxo compiler - 02/24/11 16:39

They are not found this way, as the scripts where the effects are referenced remain in sub folders.
Posted By: MMike

Re: fxo compiler - 03/12/11 19:45

we need a nodal fx editor
© 2024 lite-C Forums