Author Topic: HLSL Tunnel  (Read 9184 times)

0 Members and 1 Guest are viewing this topic.

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
HLSL Tunnel
« on: June 25, 2012 »
Having managed to get ps_3_0 shaders going I decided to try and make something moving, based the code off a glsl example from iq's shadertoy. Would probably have taken far less time if I actually new any hlsl before hand but I figured it out as I went along and got texture loading going by hacking into my bmax code a way to use the D3DX9_43.dll, this means you need the latest dx install for this to work but why wouldnt a windows user have that anyway :P

Also needs a shader model 3 card, it will likely crash on anything lower.

If you feel like letting me know if it works and what your windows version and gfx card is feel free, would be useful to see how it runs on nvidia as I only have ati :)

I know this could  be done in 1k or less in c/c++ but doing it in bmax is kinda cool, I dont really see anyone else doing it, and this is more an off shoot from me learning directx.

Cheers
Jon

Offline Xetick

  • Atari ST
  • ***
  • Posts: 132
  • Karma: 80
    • View Profile
    • Plane9
Re: HLSL Tunnel
« Reply #1 on: June 25, 2012 »
Nice tunnel! You can always check glsl.heroku.com if you need more shader ideas.
Plane9 - Home of the Plane9 3d screensaver/music visualizer
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: HLSL Tunnel
« Reply #2 on: June 25, 2012 »
I tried it on a WinVista computer with an ATI 4300HD series card, so nothing fancy, but it runs smooth and no issues at all. It looks brilliant. Would it be possible to do some kind of bumpmapping at the same time, probably using normalmaps or something? I think it would make it even more great. Good job on hacking your way into getting dx shaders working with bmax, as you mention not a lot of people dabble in that kind stuff.

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: HLSL Tunnel
« Reply #3 on: June 25, 2012 »
Works nice with Win7 and Nvidia GTX560Ti.
Challenge Trophies Won:

Offline ferris

  • Pentium
  • *****
  • Posts: 841
  • Karma: 84
    • View Profile
    • Youth Uprising Home
Re: HLSL Tunnel
« Reply #4 on: June 25, 2012 »
she's a beauty :)
http://iamferris.com/
http://youth-uprising.com/

Where the fun's at.
Challenge Trophies Won:

Offline energy

  • Amiga 1200
  • ****
  • Posts: 280
  • Karma: 25
    • View Profile
Re: HLSL Tunnel
« Reply #5 on: June 25, 2012 »
works fine here on P4 3,8ghz + Asus NVIDEA 7950GT 512mb.

Nice job. :)
coding: jwasm,masm
hobby: www.scd2003.de

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: HLSL Tunnel
« Reply #6 on: June 25, 2012 »
Runs fine windowed here on GTX850 Win64.  When trying to run fullscreen (at 1920x1080), I just get a black screen. Nice effect :)
raizor

Challenge Trophies Won:

Offline jace_stknights

  • Amiga 1200
  • ****
  • Posts: 399
  • Karma: 32
  • PEEK & POKE are not MOVEM!
    • View Profile
    • ST Knights WebSite
Re: HLSL Tunnel
« Reply #7 on: June 26, 2012 »
Nice! runs fine on my old 7100Gs with xp!
Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: HLSL Tunnel
« Reply #8 on: June 26, 2012 »
Thanks for the feedback, much appreciated.

Not sure about the blackscreen in fullscreen mode, i get that for a fraction of a second while it deals with the shader and texture loading but it runs fine, could it be the backbuffer format, I dont specify it in widowed mode but use D3DFMT_A8R8G8B8 for fullscreen? cant think of anything else that's different.

cheers
Jon

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: HLSL Tunnel Bump Attempt
« Reply #9 on: June 26, 2012 »
Well I had a go at using a normal map in this tunnel, while it adds a slightly different look it doesn't feel right to me, probably due to the actual tunnel lighting being faked in the shader code and needing to work out how to us it with the normals from the map. Pretty sure I am not doing that right but I am pretty happy to actually get the shader using 2 textures. Still this is keeping me opening the ide for a few hours having some fun and that's what its all about in the end  ;)

Attached a zip with the original and the attempted bump mapping so you can see the difference, haven't packed the exe's as a few friends had there av software claim it was infected when upx'd :-\ 

Cheers
Jon

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: HLSL Tunnel
« Reply #10 on: June 26, 2012 »
Can't make it work here Jon, mind you I have a shitty ATI card.
Screeny looks really great though!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: HLSL Tunnel
« Reply #11 on: June 26, 2012 »
Hmm, would have to be a very very old ati, I think any radeon hd is sm3+, mines only a hd4890 so its 2 or 3 generations old now itself, sure you have the dx dll I listed in the 1st post? If your not a big PC gamer you might not have an upto date dx install.

Cheers
Jon

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: HLSL Tunnel
« Reply #12 on: June 27, 2012 »
I see what you mean about the bump not turning out as great as it could. You would probably have to not have the shader darken the tunnel and have to set up lights and such. The non bump version looks better as it is now. But as you said, you figured out how to use two textures, which mean that it was not all for nothing :)