ShaderFX and Unity

I really must say that I love using ShaderFX and I’m starting to love the Unity engine.

I just have this one problem; they don’t seem to be very co-operative together.
Does anyone have an idea for easy integration of ShaderFX-shaders (.fx) in Unity (Using the ShaderLab-language)?

The answer to this pretty much defines whether or not the place I’m going to work in would use ShaderFX at all.

Thanks a lot in advance for anyone who’s willing to help! :slight_smile:

I’d suggest posting on the lumonix forums, Ben and Kees are both members here, but you’ll get a faster and better answer there, most likely (and the question may have been answered already, or others may have the same question).

Unity has its own material format that is very different from regular FX or CGFX files.
So it would require A LOT of work to try and support it in ShaderFX.

That doesn’t mean we won’t, but it does mean we’ll have to schedule a large chunk of time for it and that is hard to do.

So in the short term, we probably won’t support Unity.

-Kees

ok, thank you.

So, I’m very much a noob when it comes to shaders, so could someone help me with this one? :slight_smile:

I made a shader in ShaderFX, exported it to .cgfx-format and now I’m trying to manually port it to ShaderLab. Everything seems to go rather fine, except for these few errors it gives that seem to prevent some crucial parts of the shader from working.

Could someone check these errors and tell me what exactly they mean and how it would be best to try to fix them?

If I get this working, I could ask our coder to try and make a ShaderFX -> ShaderLab converter :stuck_out_tongue: just dreaming…

Cg in program ‘main’: error C1038: declaration of “objTangentXf” conflicts with previous declaration at (398) at line 401

Cg in program ‘main’: error C1043: size of dimension cannot be less than 1 at line 401

Cg in program ‘main’: error C1056: invalid initialization at line 401

Cg in program ‘main’: error C1060: incompatible types in initialization at line 401

Cg in program ‘main’: error C1038: declaration of “objTangentXf” conflicts with previous declaration at (453) at line 456

Cg in program ‘main’: error C1043: size of dimension cannot be less than 1 at line 456

Cg in program ‘main’: error C1056: invalid initialization at line 456

Cg in program ‘main’: error C1060: incompatible types in initialization at line 456