Home Technical Talk

Free Maya/max cgfx/fx Shader

1345
polycounter lvl 19
Offline / Send Message
Brice Vandemoortele polycounter lvl 19
Hi guys smile.gif

<font color="brown">edit: the more recent changes on the maya shader are now stored on this page </font>
I recently got into learning Cg and I figured out most free shaders out there are max ones. So I thought it might be a good idea to release what I've been doing these last few months so that people can play with it smile.gif
I tried to build the more generic shader I could, kinda 'multi-purpose'. It's mostly for testing or beauty renders, but it might be useful to someone. It's rather slow and unoptimized and only supports one lamp. I have been mostly experimenting the cg thing, not yet into efficiency smile.gif I'd like to hear about it tough.
Unfortunately I haven't been able to test it on a wide range of gpu cards, not to say 'none'. The cubemap sampling is using the texCUBElod(), wich needs PS3 (fp40 profile). I'm looking into getting it to work on previous cards using Isidoro's technique for texCUBEbias(). David Pain also mentioned me he had problem to get it running on his 8800, so any feedback is welcome smile.gif
I personally own a 6800GS on my laptop and it's running just fine.

http://www.mentalwarp.com/~brice/download/GenericBRDF_1-0.zip

I wrote a little tutorial. Any input on optimization, typos, better interface or behavior, dating, etc is welcomed.
Sorry for the huge images.
ShaderGenericTuto_v1-0.jpg
I had some great testing models thanks to Peppi and Pior smile.gif
Fzero_PiorAndPeppi.jpg
The whole stuff is released under creative commons by-sa license

Hope you like it smile.gif

Replies

  • dur23
    Offline / Send Message
    dur23 polycounter lvl 19
    I'm gonna give this a go tomorrow at work smile.gif I have to get our shader artists to make good stuff like and example always helps. smile.gif
  • aniceto
    Offline / Send Message
    aniceto polycounter lvl 18
    I really hope I can get this shader working this weekend, it looks like a heap of fun!

    these might be total newb questions - is it possible to have an environment mask, or even a BRDF mask with multiple BRDF sampler images?
    For the purpose of having multiple materials with 1 shader(eg. SSS mixed with a car paint type material)
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    Nice work. What version of maya is this created for/with?
    7's cgfx setup was somewhat annoying.
    Definitely has a few more features than my efforts.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    How awesome is that!

    I'll send you an new version of my texture maps so that they work nicely with your shader - I was using a rather different system for my screengrabs hence it seems like the maps don't translate that well.

    Can't wait to experiment with the idea of image based lighting, I've been waiting for this for a long time!
  • Ged
    Offline / Send Message
    Ged interpolator
    fantastic! my maya friends will be happy. Good question per! I want this stuff in max too
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    Hi there smile.gif
    @David: good point, there's a simple way to do it using a blend map. I wanted to give each map a separate slot since it's often a problem creating complex alpha maps without layers in photoshop, but since this one is pretty simple it could fit in the alpha channel of the diffuse for example. The code is pretty simple, but I have to pay attention that all that parameters don't become a mess, if they aren't already ^^ The best would be to have separate Offset factors, so even more stuff... :P
    I'm not sure what you mean by 'environment mask', the spec map already drives the intensity of the cubemap (specular is a reflection, I never really understood why people use different maps for it)

    @pior: hehe sorry mate, I haven't done any changes on your maps, just tweaked a few parameters, I haven't really pay attention to respect the original renders. I didn't mean to alter your work smile.gif
    Well it could be called image-based-lighting for the ambient, but for what I know the 'real' thing uses no lamp, since everything is baked in the map, which is not the case here. i did a try bellow tough, but it doesn't render as good as rthdribl (http://www.daionet.gr.jp/~masa/rthdribl/) since maya don't supports hdr buffers nor floating points images (does it?). You can tell by the gray look of the highlights, the lack of bloom etc...

    @Vailias. I actually don't know why it should make a difference, am I wrong? I think from maya 6 to 7 the flipped normal as been corrected (binormal calculation issue or something like that) and the shaders now load with the parameters in the order they appear in the code.

    @Per. well I guess it's very doable (even with shaderFX I think), but I'm not that of a max addict smile.gif

    Thanks all for your kind comments, now wait for people complaining that it actually don't work at all :P
    shaders00.jpg
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    I look into porting it, if its straight forward as it should, I will finish the job in a few hours
  • killingpeople
    Offline / Send Message
    killingpeople polycounter lvl 18
    that would be dope crazybutcher. i was excited about trying these out, downloaded them and skipped over the fact these were for maya... selective reading
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    okay uploaded a first port version. Be aware you need to have a shader model 3.0 card as minimum! (Nvidia GeForce 6, Radeon X1300) As Max handles tangent/binormal passing a bit different, to my knowledges only mapping channel 1 is allowed for normal maps. The others could be tweaked individually a bit, but for simplicity all share channel 1 now.

    I still recommend to download Brice's zip, as it comes with sample textures and that nice overview shot. I havent tested everything fully, so if problems come up let me know.

    http://www.luxinia.de/download/arttools/GenericBRDF_1-0.fx
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    Post deleted by CrazyButcher
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    Post deleted by CrazyButcher
  • Funky Bunnies
    Offline / Send Message
    Funky Bunnies polycounter lvl 17
    Whoa, Bad Ass.

    Downloading...
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    versions prior to this message, have normal mapped R&G swapped (maya seems to have different default), thanks Per for finding this bug. From now its Per-flavor normalmaps

    edit: just for record my posts purely are about the port. The CgFX one was rock solid from the beginning of time.

    edit2: and another fixes smoother result and vertexcolor was wrong.
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    Hello smile.gif Thanks to crazyButcher we now have a working shader in max! I've included it in the main archive, with a little correction, specular now take per-vertex Ambient Occlusion into account smile.gif
    and here's another mini-tutorial (also included in the archive). Hey per thanks a lot smile.gif well I learned cg because I was frustrated with the lack of free shaders out there ^^ It seems people felt the same and I'm glad I may be filling the gap a little smile.gif
    AOTuto.jpg
  • Ben Cloward
    Offline / Send Message
    Ben Cloward polycounter lvl 18
    Awesome work Brice! This is looking super cool. And you too CrazyButcher. I'm going to take a look at the differences between these and possibly use what I learn from them to add a CgFX export to ShaderFX. It's one of the things we've wanted to add for a long time. Are there any other Maya effects shaders around that I can use as reference?

    -Ben
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    Brice: Its that second part. wink.gif

    Maya7 the parameters load in pretty much whatever order they feel like, which makes setting it up over and over, or using lots of parameters rather difficult.
  • Ged
    Offline / Send Message
    Ged interpolator
    umm I dont wanna be the idoit in this thread of genius but how do I get this working in max? Ive made a new direct x material and then loaded the genericBRDF_1-0 into it. I loaded up all my textures and then applied it to my model and my model goes invisible!? I tried just applying the material without textures and its still invisible.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    you need to have the alphamap texture applied
  • aniceto
    Offline / Send Message
    aniceto polycounter lvl 18
    I think im just a maya noob. CB's port works fine for me.

    Brice, CB: me love you long time!
  • Ged
    Offline / Send Message
    Ged interpolator
    Thanks crazybutcher that sorted it out. I didnt realise you actually need to have something in every slot for it to work properly. I guess you just cant use this to show off work that only has a specular and a diffuse and normal map? or is it acceptable to fill empty slots with a white bitmap?
  • Default
    Offline / Send Message
    Default polycounter lvl 11
    hey, just thought i'd chip in my thanks for this awesome shader. great work man.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Okay I had no time to try the shader yet but a collegue gave it a spin over the weekend on a personnal character of his. I think it looks completely badass on an 'oldschool' texturing job just like that! Note that there is a bit of normalmapping on some of the mechanical parts.

    Top screenshot is the diffuse job only, bottom is the complete thing with Brice's shader in Maya hardware rendering. That kicks! It gives a kind of Pixar/TF2 quality to the skin.

    stetik_bonhommette.png

    Image courtesy of St-Etik (Amen!).
  • monkeyscience
    Offline / Send Message
    monkeyscience polycounter lvl 12
    Looks really cool! Kudos for making the Maya UI your bitch, too. I have some questions:

    Do you use LDR env cubemaps + direct light sources for some of these shots? Like the yellow hilight on Peppi's racer, that's not from the env cubemap is it?

    Do you do diffuse lighting from an env cubemap or only specular? The difference would be sampling the cubemap with the normal for diffuse and with a reflection vector for the specular ambience, but there is a noticeable visual difference.

    EQ is all excited because you got LDR maps looking good and that would eliminate all the color correction and editing nightmares we're having with HDR content. Also, how do you like CubeMapGen? We considered it for Marmoset at one point but never really followed up. Gloss maps are awesome and I want them!
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    look at the code moneky wink.gif
    btw while porting I noticed that you treat specular,SSS and emissive all as greyscale. For maximum flexibility (yeah I know I was the one who brought up pipelining first hehe) I'd suggest so that you should use color information for them. Or at least specular somehow. One could always "emulate" the old style with using greyscale textures (in case they are supposed to be compressed in a game engine later to single channel). But for the viewport I'd suggest to go for maximum possibilities. And computational there is no difference between 1D or 4D math ops afaik.
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    Hi everyone and thanks for your feedback smile.gif
    I just got back from iceland - thanks poop -, time to get back to normal life and answer this thread ^^

    Hey pior that's nice looking, I guess that using no spec avoid the lack of normal map to be obvious. This also gives even more credit to Aniceto's request, there is a need to support at least two lookup textures, since here the clothes also shows that red hue all over. It doesn't look bad tough, but it might not always be the case wink.gif
    I remember seeing some of your tests with some kind of self-illum fresnel effect, pretty much as the ones in Red Steel. It might be good effect for stylistic rendering what do you think? Could that be a cool feature

    @monkeyscience. most of the answer your looking for are in the thread already. Maya doesn't support hdr cubemaps, so these are always LDR but I use an hdr cross for filtering.
    I do use both cube and direct light for spec, so yes, the highlight on peppi's ship is the point light. The twin spheres (@pior, lower in the thread) are using a different shader and these highlights are only cubemap, no light involved. BTW the shader only supports one point light, so no 's' wink.gif
    I think the answer is said somewhere deep in the end of the tutorial hehe. see the whole point is the use of a lookup texture, but there is a kind of image-based lighting since ambient is also sampled from the cubemap.
    I just don't know any other software for cubemap than cubemapgen, but I think it's okay smile.gif you'll need to read the doc, it's not that straightforward to use. It can save hdr cube since every calculation is done in hdr, not a big deal smile.gif Most technique I saw use an exponent in the alpha of the cube, this might be tricky, I think it doesn't filter alpha. You might be able to combine everything into photoshop, but I never tried to load a cube in PS with its mipmaps. I'd like to hear about your experimentations smile.gif

    @CB and Per: You are definitely right smile.gif I did that because we use to pack those in the channels of a single RGBA in the project I'm working on ( adv - still looking for some artist - /adv time), modifying is not a big deal and it's obviously better to have that control smile.gif
    That's already some more stuff for the next version, keep up the feedbacks smile.gif
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    Am I? can I meet your sister?
  • dur23
    Offline / Send Message
    dur23 polycounter lvl 19
    Does only work in versions of maya later than say 8.0?
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Right on I gave the .cgfx and .fx another spin last night and noticed a few things.

    Seems like 3DSMax does not like UV seams very much as seen on the shoulder area ; also for some reson there is an artifact appearing where the knee bends backwards in space. Note that the Uvs are continuous on that area of the model. However wrapping seams like the ones usually showing up when using cylindrical mapping don't create artefacts. I think I have seen something very similar to that odd behaviour when using ShaderFX generated cubemap projection code. A known 3DSMax viewport bug maybe?

    Also it seems like the Maya and Max versions of the shader respectively handle the BRDF UV values in slightly different manners. Nothing that a tweak of either the UV values or the texture couldn't fix - but nevertheless a noticeable difference in looks. (darker blacks in Maya in the screenshot example)

    Anyways! Awesome tool still :P

    Some suggestions :

    - I think it would be handy to separate the projected reflected envmap from the one used for the ambiant lighting (fake GI). I know it is somehow logical to use the same cube for both but in practice it's nice to have them distinct (ie the cube used for ambiant light is likely to be much more simple with flat colors)

    - Also if the previously mentionned feature is implemented I whish to be able to override the cubemap texture used for ambiant lighting by more simple controls - on some occasions the user might want precise texture control, but in other cases a color for the top direction and another for the bottom is well enough and easier to tweak since it is mere RGB values.

    - The shader needs texture-base colored specular!

    - Last but not least I'd love to have some sort of shader blending according to a greyscale map. It could be used for a dryer look in crevices (kindof like the Zbrush3 waxy multi-matcapped materials), or in order to have metal against skin on models where there a per-faces distinction of materials is impossible.

    I don't know what would be best : combining two complete shaders, or simply combining the BRDF pass and leaving the others variables common. (I bet that most users would want the first option tho)

    Hope this helps!
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    - the darker blacks, maybe d3d viewport in general has different gamma or so?

    - the tangent differences, maybe maya just computes them better, nevertheless I can experiment with that (send me a testmodel)

    - cubeambi, so you want hemispheric lighting based on two colors (sky, ground) next to cubemap ambi

    - blending, I'd suggest to do greyscale blending of two different BRDF texture setups. it's rather simple to add + leaves maximum flexibility. the regular "simple gradient" would be basically same as "normal" shaders work.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Sure thing I'll send you the model asap (don't have it with me atm). As for the Sky and ground colors, yeah that's exactly that. Being able to switch between a cubemap and simple hemispherical settings would be great.

    As for the BRDF blending, just to make sure we are talking about the same thing : I meant a blendmap painted on the UV map, to separate material behaviour in crevices or wher etwo materials meet (not just the mix of two BRDF into one, applied as a whole on the model). Yay!
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    hi there.
    Using a blend map is exactly what I did for aniceto's request. I'll release it soon.
    The sky/ground color is a cool way to approximate ambient. I could do that but it will be a separate technique. Also I'm not sure to catch the purpose of having two cubemaps. Having 'more simple, flat colors' is the whole point of the AmbientBlurFactor.
    I did check your seam issue with a model of mine and I can't reproduce it, I'll be glad to have a look at your files.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Yup I'll send you guys the file asap.

    As for a separated cubemap for the ambiant fake, yeah Im fine with it being locked with the reflected cubemap, especially if you developp a separated technique that the user can pick if one prefers to define ambiant lighting using simple color pickers. (and thus, still using a cubemeap for the reflected environment).

    Also regarding the 'separated fresnel' you mentionned earlier. Well I'm fine with the shader as it is atm since I can define a fresnel rimlight effect by editing the BRDF texture, but I understand that one would like to produce the effect overlaid on top of the shader, using a user-picked color and a few numerical parameters to define the looks of the effect. Params would be rimfresnel color, power value (=spread) and intensity value (=opacity of the effect). That would be definately easier to tweak than adding a subtle gradient on the edge of the BRDF map.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Hmm thanks Brice (and CrazyButcher)! I've been messing around with the 3dsMax version today, it works great smile.gif
    The only thing it's missing at the moment is coloured specular. Seems odd that a shader with such great possibilities would be missing a feature like this.
    Any chance of being able to update the 3DS Max fx shader to use colour information from the specular map?
  • arshlevon
    Offline / Send Message
    arshlevon polycounter lvl 18
    forgive me if this was mentioned, i cant find any info, but does this work with maya 8.5?
    i was using it at work on 8 and everything worked fine.
    now i am at home playing around and i get funky results.
    might be video card too, i have an 8600 at home, and a quatro at work. i will try and show results on same two objects, but i have to goto work tomorrow to compair. it basically outlines everything in a harsh harsh black, almost as if the fresnel effect was black, but there was no smooth falloff, it was just a hard line, no transistion, and after i add all the maps the whole thing looks black, the spec looks great though.
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    Hi there. I wrote a new version of the shader, but I need to clean it. There's only one technique atm, so you always need to fill both BRDF lookup and blend map. I'm looking into separate simple BRDF and the blend BRDF into two clean cod... not that easy ^^
    I also found a bug in the code that only shows up on nividia 8800, and 8600 according to arshlevon. looks like the bug you talk about.
    I'm only working on the maya version atm, sorry guys :P

    btw pior's bug seem to be a max one, everything looks fine when re-importing the obj.



    shader_1_1.jpg
  • nacire
    Offline / Send Message
    nacire polycounter lvl 17
    I assume I'm getting this error because I'm on an ATI 9800 Pro? Is it the shader model 3 support the card is lacking? I've needed to upgrade for sometime now, but I'm feeling the need more everyday. frown.gif



    AEcgfxShader_fileChoice 1 shader "C:/Documents and Settings/Forrest/Desktop/BDRF Shader/GenericBRDF_1-0.cgfx" "";
    cgfxShader -e -fx "C:/Documents and Settings/Forrest/Desktop/BDRF Shader/GenericBRDF_1-0.cgfx" cgfxShader3;
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The compile returned an error. //
    // Error: //
    // cgfxShaderNode::cgErrorCallBack
    // Error: CG ERROR : The compile returned an error. //
    // Error: //
    // Error: cgfxShader "cgfxShader3" unable to load effect "C:/Documents and Settings/Forrest/Desktop/BDRF Shader/GenericBRDF_1-0.cgfx" //
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    while yes there is a shadermodel3 instruction in there (for blurred cubemaps), you will not be able to run shadermodel3 stuff under ATI cards at all in Cg currently. So better wait for brice doing a sm2 version which will run on ati, too, or get a new nvidia card.
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    grmlml well I gave up separating the code, I've just duplicated everything. Here's the maya version, I will look into the max one later on.
    http://www.mentalwarp.com/~brice/shader.php

    It contains three techniques, two for PS3 model with the regular blurry reflection. The second however use a simple ambient interpolating between ground an sky colour. The last one doesn't use the blurry reflections. The cubemap is displayed with its highest mimap level and is then compatible with ps2 cards.
    Beware that the tuto is not up to date, I'll post an updated version soon smile.gif
  • Brice Vandemoortele
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    I updated the 3dsmax one as well, with a few changes so. Biggest difference between the two will be that I kicked alphamap and do alphatesting based on diffuse.alpha
    and that subsurface is controlled with its own texture.
    also I removed the colorswatches for specular,subsurface and emissive accordingly. (the other new features like brdf mixing and ambient hemispheric lighting are same)

    there is 4 techniques the sm3 ones allow blurred access of the cubemaps, the others not. Then there is ambient cube and ambient hemispheric.

    <font class="small">Code:</font><hr /><pre>
    // complete new codebase for pixelshader
    // removed color pickers, colors are always encoded into textures now (emissive,specular,sss)
    // alphatesting based on diffuse.alpha
    // subsurface map replaced alphamap so that perpixel ssscolor can be done
    // blending between two BRDFs possible (0 and 1) white in blendmap is BRDF1
    // dedicated ambient cubemap
    // hemispheric ambient lighting as second technique
    // two sets of shader versions (sm3 and sm2a cards)
    </pre><hr />

    Link: http://www.luxinia.de/index.php/ArtTools/3dsmaxFX#genbrdf

    edit: missed the new new rim light wink.gif fixing..
    edit2: fixed

    I think a next version would bring support for more lights, once I find time end of week I will do.
  • Laheen
    Offline / Send Message
    Laheen polycounter lvl 18
    Hmm.

    The max version is a viewport shader right? Because I'm loading it in and it's saying there is "No valid techniques found".

    Any help on how to get this working? I'm a shader nub.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    I just updated the 3dsmax shader quite a bit again
    the color pickers are back. additionally 3 lights are supported.

    I also added techniques for all sm2 cards, due to instruction limits however the cheapest shader will not support any color picker, also bumpfactor will be ignored, and blending between two brdfs is disabled, as is rimlighting. The core functionality could be preserved so.

    hence laheen, if you download now there should be techniques for your hardware, too.

    if there are bugs left, it's all per's fault doing bad QA.
  • nacire
    Offline / Send Message
    nacire polycounter lvl 17
    When using Maya 7 I can't get the 1.0 or the 1.1 version to work. I'm using an ATI 9800 Pro with up to date drivers.
  • pliang
    Offline / Send Message
    pliang polycounter lvl 17
    How does it work with a Nvidia 8800 GTS on Maya 2008?
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    "not working" is a pretty vast issue, nacire
    Have you tried the alternate techniques? the default one is still a ps3 one, that won't work with your ATI card.
    pliang what's your question?
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    slight update: using hemispheric ambient is now just a checkbox in the ps3 technique, and used by default on the ps2

    Nacire: CB just told that the problem is actually in the number of instructions your card supports in one shader. I'm sorry but actually won't go in trying to solve this since learning cg - for recent targets - was my initial goal. Chris might do something about it on his own tough smile.gif
  • nacire
    Offline / Send Message
    nacire polycounter lvl 17
    Hey no worries Brice! This is just about the best real-time shader I've seen and I really wanted to use it! I'm definitely behind the times in terms of graphics card tech. I'll just chalk this one up as another pro when deciding whether or not to buy a new card.

    Just to show you what's actually happening when I try to load the shader. Hope this isn't too long, I just thought you might be interested. Cheers and thanks for giving everyone such a great tool!

    Shader 1.0

    AEcgfxShader_fileChoice 1 shader "C:/Program Files/ASDN/CgFXSL/CgFX files/for.Normal/BDRF Shader/GenericBRDF_1-0.fx" "";
    cgfxShader -e -fx "C:/Program Files/ASDN/CgFXSL/CgFX files/for.Normal/BDRF Shader/GenericBRDF_1-0.fx" cgfxShader1;
    // Error: CG ERROR : The compile returned an error. //
    // Error: (56) : error C8001: Unknown state 'MipFilter'
    (56) : error C1008: undefined variable "None"
    (59) : error C8001: Unknown state 'AddressU'
    (59) : error C1008: undefined variable "Clamp"
    (60) : error C1008: undefined variable "Clamp"
    (60) : error C8001: Unknown state 'AddressV'
    (61) : error C1008: undefined variable "Clamp"
    (61) : error C8001: Unknown state 'AddressW'
    (94) : error C8001: Unknown state 'MipFilter'
    (94) : error C1008: undefined variable "Linear"
    (95) : error C8001: Unknown state 'AddressU'
    (95) : error C1008: undefined variable "WRAP"
    (96) : error C1008: undefined variable "WRAP"
    (96) : error C8001: Unknown state 'AddressV'
    (125) : error C8001: Unknown state 'MipFilter'
    (125) : error C1008: undefined variable "Linear"
    (126) : error C1008: undefined variable "WRAP"
    (126) : error C8001: Unknown state 'AddressU'
    (127) : error C8001: Unknown state 'AddressV'
    (127) : error C1008: undefined variable "WRAP"
    (152) : error C1008: undefined variable "Linear"
    (152) : error C8001: Unknown state 'MipFilter'
    (153) : error C1008: undefined variable "WRAP"
    (153) : error C8001: Unknown state 'AddressU'
    (154) : error C1008: undefined variable "WRAP"
    (154) : error C8001: Unknown state 'AddressV'
    (181) : error C1008: undefined variable "Linear"
    (181) : error C8001: Unknown state 'MipFilter'
    (182) : error C1008: undefined variable "WRAP"
    (182) : error C8001: Unknown state 'AddressU'
    (183) : error C8001: Unknown state 'AddressV'
    (183) : error C1008: undefined variable "WRAP"
    (222) : error C1008: undefined variable "Linear"
    (222) : error C8001: Unknown state 'MipFilter'
    (223) : error C8001: Unknown state 'AddressU'
    (223) : error C1008: undefined variable "WRAP"
    (224) : error C8001: Unknown state 'AddressV'
    (224) : error C1008: undefined variable "WRAP"
    (251) : error C1008: undefined variable "Linear"
    (251) : error C8001: Unknown state 'MipFilter'
    (252) : error C8001: Unknown state 'AddressU'
    (252) : error C1008: undefined variable "WRAP"
    (253) : error C8001: Unknown state 'AddressV'
    (253) : error C1008: undefined variable "WRAP"
    (291) : error C8001: Unknown state 'MipFilter'
    (291) : error C1008: undefined variable "LINEAR"
    (487) : error C8001: Unknown state 'AlphaBlendEnable'
    (487) : error C1008: undefined variable "FALSE"
    (488) : error C8001: Unknown state 'CullMode'
    (488) : error C1008: undefined variable "CW"
    (489) : error C1008: undefined variable "TRUE"
    (489) : error C8001: Unknown state 'ZWriteEnable'
    (490) : error C1008: undefined variable "LESSEQUAL"
    (490) : error C8001: Unknown state 'ZFunc'
    (491) : error C8001: Unknown state 'ZEnable'
    (491) : error C1008: undefined variable "TRUE"
    (493) : error C8001: Unknown state 'VertexShader'
    (494) : error C8001: Unknown state 'PixelShader' //
    // cgfxShaderNode::cgErrorCallBack
    // Error: CG ERROR : The compile returned an error. //
    // Error: (56) : error C8001: Unknown state 'MipFilter'
    (56) : error C1008: undefined variable "None"
    (59) : error C8001: Unknown state 'AddressU'
    (59) : error C1008: undefined variable "Clamp"
    (60) : error C1008: undefined variable "Clamp"
    (60) : error C8001: Unknown state 'AddressV'
    (61) : error C1008: undefined variable "Clamp"
    (61) : error C8001: Unknown state 'AddressW'
    (94) : error C8001: Unknown state 'MipFilter'
    (94) : error C1008: undefined variable "Linear"
    (95) : error C8001: Unknown state 'AddressU'
    (95) : error C1008: undefined variable "WRAP"
    (96) : error C1008: undefined variable "WRAP"
    (96) : error C8001: Unknown state 'AddressV'
    (125) : error C8001: Unknown state 'MipFilter'
    (125) : error C1008: undefined variable "Linear"
    (126) : error C1008: undefined variable "WRAP"
    (126) : error C8001: Unknown state 'AddressU'
    (127) : error C8001: Unknown state 'AddressV'
    (127) : error C1008: undefined variable "WRAP"
    (152) : error C1008: undefined variable "Linear"
    (152) : error C8001: Unknown state 'MipFilter'
    (153) : error C1008: undefined variable "WRAP"
    (153) : error C8001: Unknown state 'AddressU'
    (154) : error C1008: undefined variable "WRAP"
    (154) : error C8001: Unknown state 'AddressV'
    (181) : error C1008: undefined variable "Linear"
    (181) : error C8001: Unknown state 'MipFilter'
    (182) : error C1008: undefined variable "WRAP"
    (182) : error C8001: Unknown state 'AddressU'
    (183) : error C8001: Unknown state 'AddressV'
    (183) : error C1008: undefined variable "WRAP"
    (222) : error C1008: undefined variable "Linear"
    (222) : error C8001: Unknown state 'MipFilter'
    (223) : error C8001: Unknown state 'AddressU'
    (223) : error C1008: undefined variable "WRAP"
    (224) : error C8001: Unknown state 'AddressV'
    (224) : error C1008: undefined variable "WRAP"
    (251) : error C1008: undefined variable "Linear"
    (251) : error C8001: Unknown state 'MipFilter'
    (252) : error C8001: Unknown state 'AddressU'
    (252) : error C1008: undefined variable "WRAP"
    (253) : error C8001: Unknown state 'AddressV'
    (253) : error C1008: undefined variable "WRAP"
    (291) : error C8001: Unknown state 'MipFilter'
    (291) : error C1008: undefined variable "LINEAR"
    (487) : error C8001: Unknown state 'AlphaBlendEnable'
    (487) : error C1008: undefined variable "FALSE"
    (488) : error C8001: Unknown state 'CullMode'
    (488) : error C1008: undefined variable "CW"
    (489) : error C1008: undefined variable "TRUE"
    (489) : error C8001: Unknown state 'ZWriteEnable'
    (490) : error C1008: undefined variable "LESSEQUAL"
    (490) : error C8001: Unknown state 'ZFunc'
    (491) : error C8001: Unknown state 'ZEnable'
    (491) : error C1008: undefined variable "TRUE"
    (493) : error C8001: Unknown state 'VertexShader'
    (494) : error C8001: Unknown state 'PixelShader' //
    // Error: cgfxShader "cgfxShader1" unable to load effect "C:/Program Files/ASDN/CgFXSL/CgFX files/for.Normal/BDRF Shader/GenericBRDF_1-0.fx" //


    Shader 1.1

    AEcgfxShader_fileChoice 1 shader "C:/Program Files/ASDN/CgFXSL/CgFX files/for.Normal/BDRF Shader/GenericBRDF_1-1.cgfx" "";
    cgfxShader -e -fx "C:/Program Files/ASDN/CgFXSL/CgFX files/for.Normal/BDRF Shader/GenericBRDF_1-1.cgfx" cgfxShader1;
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The profile is not supported. //
    // Error: //
    // Error: CG ERROR : The compile returned an error. //
    // Error: (620) : warning C7011: implicit cast from "half4" to "float3"
    //
    // cgfxShaderNode::cgErrorCallBack
    // Error: CG ERROR : The compile returned an error. //
    // Error: (620) : warning C7011: implicit cast from "half4" to "float3"
    //
    // Error: cgfxShader "cgfxShader1" unable to load effect "C:/Program Files/ASDN/CgFXSL/CgFX files/for.Normal/BDRF Shader/GenericBRDF_1-1.cgfx" //
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    the .fx file is just for 3dsmax (but superceded by the version on luxinia.de)

    the .cgfx file is not working for the same reason people brought up the "profile is not supported" error before, your hardware doesnt support it.

    I sent Brice an optimized cgfx version to make it work for his codebase, too. he probably updates the stuff later.
  • nacire
    Offline / Send Message
    nacire polycounter lvl 17
    [ QUOTE ]
    the .fx file is just for 3dsmax (but superceded by the version on luxinia.de)

    [/ QUOTE ]

    Doh! All of the times I looked at those two files and I never noticed one was a .fx! mad.gif
  • Ruz
    Offline / Send Message
    Ruz polycount lvl 666
    been messing around with the max version.
    very nice stuff guys. best shader I have used.

    shader1bw3.jpg

    i probably am not using the shader as well as i should but i think its on the right track.
1345
Sign In or Register to comment.