Anyone worked with shaderfx and unity. Heard some rumours about support for unity in shaderfx but there is no unity export in shaderfx. any other export format suited for unity?
Maybe this belongs at the shaderfx forum but what the heck. I’m signed up here and thought maybe you have some experince with this?
there is an article about it in the wiki…
somebody succesfully got an shaderfx-shader working in unity… but it seems to be quite a workaround…
shaderfx->fxcomposer->unity and the need of rescripting some components (if i got that right, im just an artist, no scripter)
i understood that unity doesn’t support these semantics directly.
now, reading unity’s shaderlab built-in state variables i found these
glstate.matrix.mvp
Current modelviewprojection matrix glstate.matrix.modelview[0]
Current modelview matrix glstate.matrix.projection
Current projection matrix glstate.matrix.transpose.modelview[0]
Transpose of modelview matrix glstate.matrix.invtrans.modelview[0]
Inverse transpose of model*view matrix glstate.matrix.texture[0] to glstate.matrix.texture[7]
Texture transformation matrices
ok, i’m interested to know how i can use the glstate model space matrices to get the aformentioned world view/projection matrices. or is there another way to do it?
i’m kinda new to this and i’m interested in porting a shaderfx exported cgfx file into unity.
i think i understood how to convert most of the shaderfx file for it to work in unity, but this section with lacking world matrix semantics and how to figure out a viable solution for them using built-in unity helper functions has given me some pause :shock:
anyone has an idea how i should do/write this little conversion ? thx
ps: i just found these variables too in the unity documention, still trying to figure how to use them
Transformations Name
_Object2World float4x4
_World2Object float4x4
_ObjectSpaceCameraPos float3
Yes, indeed, these are also mine questions. Would be nice to get some clarification from the programmers as YOU are the ones who should know which Shader Matrix contains which information.
Would be pretty cool use to all the wicked .fx shaders which float around…
I’d love to see shaderFX support in Unity. Especially now that ShaderFX 3.x ia free so any Max user can use it.
I’ve used it quite a bit with ogre before coming here and it’s the one thing in my pipeline I really miss. The shaders that come with unity are decent but don’t produce as good results as some of my shaderFX made shaders.
i remember a post written by the ShaderFX programmer on a 3ds Max board, stating that he was looking into Unity support, but decided to not implement it, because shaderlab is a so total different and non-standard beast…
And since it’s free now, i don’t see unity support is coming anytime…
I guess the next best thing would be a FX composer 2 exporter. Both shaderFX and Mental mill are compatible and can produce HLSL or CGFX versions of shaders.
HLSL is pretty similar to CG which is what you use to write shader code in unity.
The alternative is GLSL for opengl only naturally.
shaderlab is not related to any of that at all kind of as shaderlab is the “fixed function and pass pipeline setup”. you can’t define programmable gpu code in shaderlab thats cg