Pixel Shaders!



  • I've been learning some HLSL for the game I'm working on and it seems pixel shaders will be extremely useful for a 2D sprite-based game. The only problem is a general lack of samples and examples (or TRWTF is my weak google-fu). I'm using pixel shaders only, vertex shaders are not particularly useful in a 2D game. Also I'm using XNA 4.0 and Pixel Shader model 3 (DirectX 9c). The game is science fiction with both space and ground modes so I think the possibilities for shaders are limitless.

    Anybody here used shaders before? Found any cool samples or examples online? I'm just looking for effect ideas, not necessarily implementations. I think properly-used shaders could really help polish my game but other than some basic bloom/glow/saturate effects and a GPU-based Perlin noise generator I'm working on, I'm not really sure what all can be done.



  • @mott555 said:

    Anybody here used shaders before? Found any cool samples or examples online? I'm just looking for effect ideas, not necessarily implementations. I think properly-used shaders could really help polish my game but other than some basic bloom/glow/saturate effects and a GPU-based Perlin noise generator I'm working on, I'm not really sure what all can be done.

    For random examples and "inspiration", there's Shadertoy. They demoed it this year at SIGGRAPH's Real Time Live show, and some of the stuff on there looked pretty awesome. Everything on there is done using pixel/fragment shaders only, even the stuff that's 3D. Not sure if there's anything directly applicable to a game, but if you want to see what's possible with pixel shaders only, well, there's some pretty crazy stuff right there.



  • @cvi said:

    Shadertoy.
     

    Crashes/hangs all my browsers. Good job, website!


  • Discourse touched me in a no-no place

    @dhromed said:

    @cvi said:

    Shadertoy.
     

    Crashes/hangs all my browsers. Good job, website!

    Patchy on FF27. Chrome was... interesting:



  •  I should try it at home with the beefy video card.



  • @dhromed said:

    @cvi said:
    Shadertoy.
    Crashes/hangs all my browsers. Good job, website!
    Same here. I middle-clicked to open it in a new tab and PJH's post was in the middle of the screen. My browser froze as the website opened, and I had to stare at Buttcrack Guy™ until I was able to kill the process.

     



  • Yup, immediately pegs a CPU and hangs my home machine as well.

    That's some fine coding there!

    So I don't know who's going to teach mot555 about shaders, but it sure as fuck isn't going to be Shitty Shadertoy.



  • @dhromed said:

    @cvi said:

    Shadertoy.
     

    Crashes/hangs all my browsers. Good job, website!

    I must be doing something wrong.  Works fine for me.  Firefox 21, Windows 7, cheap low-end video card.

     



  •  Could be AMD/Nvidia difference. What's yours? Mines are AMDs, both on the vista and the 8 machine.



  • @dhromed said:

     Could be AMD/Nvidia difference. What's yours? Mines are AMDs, both on the vista and the 8 machine.

    Mine says ATI Radeon HD 4650 - Paid $59 for it 3 years ago.



  • Firefox and NVIDIA on everything I tried. My work PC has some kind of Quadro workstation card, my home PC has a GeForce GTX 460. Neither are cheap GPUs.



  • @mott555 said:

    Firefox and NVIDIA on everything I tried. My work PC has some kind of Quadro workstation card, my home PC has a GeForce GTX 460. Neither are cheap GPUs.

    Weird. FWIW, for me it works more or less fine with Firefox and various NV GPUs (GTX 480 and newer). Some of the examples try to use WebAudio, which apparently my terribly outdated firefox (17) doesn't support. Other than that I've not had any major issues. Also, no crashes.



  • @cvi said:

    For random examples and "inspiration", there's Shadertoy.

    For a non-browser-based fragment shader testbed there's also Fragmentarium. Its examples are oriented towards fractals, but I think you can find one or two which load a texture and do things with it.


Log in to reply