Search Unity

Two questions

Discussion in 'Shaders' started by FancyPants, Jul 7, 2005.

  1. FancyPants

    FancyPants

    Joined:
    Jun 30, 2005
    Posts:
    38
    1) What language are the shaders in?
    and
    2) Is there any documentation on it, in regards to Unity, or is google going to be my friend?

    Thanks,
    --Thomas

    ps
    I don't suppose there is any chance that some of the shaders used in GooBall could be released as examples? :) *Pretty-please with sugar on top*
     
  2. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    The shader language is a custom made one. There is a ShaderLab tutorial shipped with the manual (Unity Manual, near the bottom of the TOC)

    If you want examples, take a look at the toon-shaders.

    We can ship all shaders for GooBall but the actual GooBall. Problem is that is is done with an old version of ShaderLab, and I don't feel much like spending too much time bringing some old special-cased shaders up to date.
     
  3. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    Hello Nicholas,

    may i ask why you're having your own shader-language?


    Greetings,

    taumel
     
  4. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    What else is there? No other language allows you to set up render states like blendmode, fog parameters, etc...

    CgFX has come along now, but given NVidias somewhat less than stellar track record on ATI cards makes me wary of this one. Besides, by the time CgFX shipped, we already had had our own - that (unlike CgFX) is built to integrate with external lighting systems.

    For vertex and fragment programs, you can use Cg, ARB_FP, ARB_VP, ATI_TEXT_FRAGMENT_SHADER, Mainly, just go with Cg - it is there, it is cross platform, it runs on just about anything (provided you limit what you do with it to certain graphic cards).
     
  5. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    I thought you were using openGL2 shader language.

    How much work has to be done to get a shader out of renderMonkey or FXcomposer working?

    One more thing: Is multitexturing supported in the indie-version?


    Greetings,

    taumel
     
  6. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    GL2 is not supported well enough on old cards/os combos. The nice thing about Cg is that we can compile it down into ARB_VP/FP programs and there are no user req.s then.

    You can use multitexturing in the indie version - take a look at http://www.otee.dk/gallery/shaders.html All of these shaders work in the indie version, and the e.g. the reflective specular bumped shader uses 3 textures (bump, diff/gloss/ reflection).

    Unity does not support reading in multiple UVs from a 3D file at this time. You can naturally scale/offset the textures.
     
  7. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Sorry - didn't notice your second question...

    I'm not sure how long time it would take to move a shader from CgFX to ShaderLab. The first one you do is probably gonna take a while ;-)

    After that, I would guess like 1/2-2 hours per effect. Again, it depends a lot on the effect: lots of shader code, little state changes means more copy/paste, whereas state changes, multiple passes, fallback effects, etc. means more rewriting....
     
  8. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    >>>Sorry - didn't notice your second question...<<<

    No problem just popped in too. :O)

    >>>After that, I would guess like 1/2-2 hours per effect. Again, it depends a lot on the effect: lots of shader code, little state changes means more copy/paste, whereas state changes, multiple passes, fallback effects, etc. means more rewriting....<<<

    Okay this worked perfectly well in virtools if exporterd from FXcomposer. Exported, imported and they ran. This was great! I suspect that it also depends on the shadercode but the ones i've tested just worked from scratch.


    Greetings,

    taumel
     
  9. Guest

     
  10. taumel

    taumel

    Joined:
    Jun 9, 2005
    Posts:
    5,292
    Forget the last statement...that happens when coming to the site without being logged in and wanting to correct something...*dumtidum*


    Gretings,

    taumel