If you were on desert island which shader would you bring ?

Last post 04-14-2008, 11:55 AM by kewlniss. 9 replies.
Sort Posts: Previous Next
  •  04-01-2008, 8:31 PM

    If you were on desert island which shader would you bring ?

    I doing a small demo, sort a learning demo,and I asked myself if shader are really necessary ? I took two example in the past I really loved ( i'm not expection doing the next bioshocl) hlaf life2 and Fear. the first one use so many shader and use most of ist effect by texturing and the other one shadow mapping normal mapping and maybe more.

    The difference weren't really huge ( I asked to my girlfriend to have objective point of view).



    I would like to know from more experienced user which shader they use and if they were aiming low computer which one would they use.


    cheers

  •  04-02-2008, 1:14 AM

    Re: If you were on desert island which shader would you bring ?

    Really thats far too huge a question to answer. Every game uses many different shaders for many different effects and most of them switch on the fly depending on yuor hardware level.

    I don't think there is any shader that anyone must have becuase it depends so much on the game genre, art style and machine abilities.



    The ZBuffer - News and information for XNA and Managed DirectX
  •  04-02-2008, 2:22 PM

    Re: If you were on desert island which shader would you bring ?

    My base "model" shader, used by 90% of my objects, supports diffuse texture, normal map, and gloss map, all per-pixel. That's the most of what you need. I would perhaps want to add a shininess map (perhaps use alpha of gloss); additionally I could see using parallax mapping (in the normal map channel) and ambient occlusion (perhaps in the diffuse map alpha, if that's unique to the mesh and wasn't used for transparency). With this one shader, most of the surface characteristics can be captured in only three texture operations, which is a good quality/performance trade-off for current low- to mid-end PC hardware.

    My terrain shader uses one control texture, five splat textures, and one normal map texture (to avoid lighting popping when switching LODs). It's very speficic to the needs of my terrain, though, and wouldn't be as generally useful. The model shader could be used for a larger number of objects.

    The most important thing, though, is having artists who know how to use the shader. If they don't, then anything will look equally bad.

    Finally, if I were to go on a desert island, and have to bring only one shader, but I could pick anything, I think it would be something out of DOA:X2 ;-)


    --
    Jon Watte, Direct3D MVP
    kW X-port 3ds Max .X exporter
    14 days after getting my RROD box back, it's going back for service again. Grr.
  •  04-02-2008, 7:28 PM

    Re: If you were on desert island which shader would you bring ?

    jwatte:
    The most important thing, though, is having artists who know how to use the shader. If they don't, then anything will look equally bad.


    That is a tremendously important point.

    Sad though this is for a non-artist programmer such as myself to admit, the fanciest shader in the world won't help if you have no good artwork, while even something as simple as BasicEffect can look great if given the right artwork.

    When it comes to making artwork, getting too complex can actually make things worse. You can easily get lost in the different permutations of diffuse map, normal map, gloss map, etc, and end up without any clue how to make good looking textures. If you don't already have artists who know how to use this stuff, I would take it slow. Start with just a single diffuse map, and figure out how to make that look as good as possible. Once you have great diffuse textures, then introduce the normalmap, and learn how to make that look good. Rinse, lather, repeat.

    If I had to settle on a desert island, I'd take SpriteBatch plus a good artist :-)

    --
    XNA Framework Developer
    blog - homepage
  •  04-02-2008, 7:48 PM

    Re: If you were on desert island which shader would you bring ?

    Glad to hear some feedback. You two give some point to think and also a sort of echo of one other tread about the importance for an artist to be a sort of programmer. I'm an artist so I do my own artwork but the problem is that I barely know hlsl so maybe as shawn said I'll wait until I get everything under control. Do you know any book or ebooks about hlsl like real basics and not random explanation ?

    Jwatte you said using one shader is good for the perfomance ?


  •  04-03-2008, 12:11 AM

    Re: If you were on desert island which shader would you bring ?

    Yes, there is a cost to switching between shaders. If you use multiple different shaders, then you should sort your geometry by shader, and render everything with shader A first, then everything with shader B. Unfortunately, you have to render transparent/translucent stuff sorted from far to near, so there you have to eat the shader switch cost -- or render everything translucent with the same shader (which is quite feasible).

    There is also a cost to rendering things with a too expensive shader. You probably don't need a shader that supports refractance, parallax mapping, and two-tone fresnel-based metallic shimmer to render all the dirt on the ground. If the dirt covers a large area of the screen, it's probably faster to switch to a simpler shader for the dirt (again, sort by shader).

    However, this is all academic until you've actually gotten the shaders working :-) I suggest you figure out how to make the shaders "go" first, and don't worry about performance until you have enough things on the screen that it matters. If you hit 60 frames per second on your console, there really is no need to optimize...

    Sorry, I don't know of any good books. I learned this stuff through procedural shading (back in the POV-ray and Renderman days, as well as writing my own ray tracer). I then learned the HLSL specifics through following the tutorials in the DirectX SDK, and ATI RenderMonkey and NVIDIA shader composer. It's important to realize that NVIDIA CG is very similar to HLSL, so a tutorial for CG will teach you a lot about HLSL. At the beginning, CG and HLSL were identical, but they have now diverged slightly in the latest incarnations with the latest features like interfaces, AFAIK.


    --
    Jon Watte, Direct3D MVP
    kW X-port 3ds Max .X exporter
    14 days after getting my RROD box back, it's going back for service again. Grr.
  •  04-03-2008, 10:34 PM

    Re: If you were on desert island which shader would you bring ?

    Sueds:
    Do you know any book or ebooks about hlsl like real basics and not random explanation ?


    Of course I'll recommend my own book :)  Chapters 12 covers basic HLSL and 13 covers more advanced topics like vertex displacement and post processing effects.

    For free resources, you may try the DirectX 9 SDK help files (unless they have been updated, I didn't find the DX10 SDK help files as beneficial on teaching HLSL).  Reimer also has some tutorials on it.  I believe he also has a book coming out soon and I would have to think he will have a lot of info on shaders in there as well.

    Hope this helps,

    Chad


    Microsoft XNA Unleashed - 2D, 3D, HLSL, Content Pipeline, XACT, Particle Systems, AI, Physics, Game States, Performance, Garbage Collection and 2 full games!
  •  04-11-2008, 2:47 PM

    Re: If you were on desert island which shader would you bring ?

    i just bought your book and I was wondering if I'll need to buy the next one or no. Will you work on model collision this time ?

    nice book by the way !

    cheers
  •  04-14-2008, 10:19 AM

    Re: If you were on desert island which shader would you bring ?

    Hmmmm...If I was on a deserted island what kind of shader would I take?

    That is a tough question.

    I would take a boat shader.  :o)

  •  04-14-2008, 11:55 AM

    Re: If you were on desert island which shader would you bring ?

    Sueds:
    i just bought your book and I was wondering if I'll need to buy the next one or no. Will you work on model collision this time ?

    nice book by the way !

    cheers

    Glad you like the book!  The physics chapter has information on model collision detection and collision response.  At this point, I'm unsure if any additional information will be provided in regards to that.  I believe the main additions will be networking, Zune development, information on the Xbox LIVE Community Games and any other major things that will come out with XNA Game Studio 3.0 that hasn't been announced yet.  (Do not take that sentence as though there is more things that will be announced for 3.0 as I have no idea ... but if there are, the intent is to make sure they make it into the book)

    Hope this helps,

    Chad



    Microsoft XNA Unleashed - 2D, 3D, HLSL, Content Pipeline, XACT, Particle Systems, AI, Physics, Game States, Performance, Garbage Collection and 2 full games!
View as RSS news feed in XML
©2007 Microsoft Corporation. All rights reserved. Privacy Statement Terms of Use Code of Conduct Feedback