Author Topic: Blitzmax shader test  (Read 5222 times)

0 Members and 1 Guest are viewing this topic.

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Blitzmax shader test
« on: March 21, 2009 »
As you know I have been coding an opengl engine in blitzmax, well I got stuck on something so decided to see if I could get GLSL shaders to work in bmax. Sfter hunting for information on shaders and how to use them in opengl I tired for several hours to work out first if bmax had all the calls available, which it does, I then spent several more hours learning how to call them in the right order with various degrees of success. Then I struggled on some more trying to work out how to get the shader code into the shaders, getting it in the right format proved more of a challenge than everything else, but finally life appeared on my screen :)

So here is a test.exe which shows that bmax can do shaders and that I managed to get one into it, it was hard work and its rather ugly code and I have no idea if I am cleaning up after myself when you exit correctly SO it might have a memory leak, but it should be right :)

The actually vertex and fragment shader code is from an example I got off the net since I have never coded a shader, there included in the archive since i could not get the code to compile if I added them to the exe, something else to sort out at some point :)





Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Blitzmax shader test
« Reply #1 on: March 21, 2009 »
It looks cool :)  [edit] I just had a look at those shader files. It looks like a certain amount of understanding of math is involved. The fortunate thing is that a lot of complete shader files can be found around the web.
« Last Edit: March 21, 2009 by zawran »

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: Blitzmax shader test
« Reply #2 on: March 23, 2009 »
thanks for trying it out, was hoping to get alittle more feedback so I could tell it this was working correctly on more systems but it seems to have been a very quiet weekend on DBF :)

So far I have had it tested on vista32 with Geforce 8500, vista64 with radeon 4870x2 and xp32 with radeonx1650 and its worked fine so I am fairly confident that it's doing everything correctly, I will likely do some more testing onve I explore this area some more but for now I want to get some more functions into my oglengine for lights,camera and texturing :)


Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: Blitzmax shader test
« Reply #3 on: March 23, 2009 »
I got around 40 FPS on my computer.
Ati Radeon Xpress 1100
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1294
  • Karma: 466
    • View Profile
    • my stuff
Re: Blitzmax shader test
« Reply #4 on: March 23, 2009 »
works fine on a geforce 8600 gts.
Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: Blitzmax shader test
« Reply #5 on: March 23, 2009 »
thanks for testing it out folks  :)

I guess the ati xpress chipset might not be the fastest at shaders since its from the look of the ati site a laptop intergrated solution, but its nice to know it actually worked  ;)

I did finally work out why I could not include the shaders in the exe and have fixed that problem so I can cross that of my list, I also found a much simpler way to load said shader source into the correct format to pass to opengl, not that it improves proformance but the code looks much cleaner. Hopefully as my engine progresses and I get to the point of adding more advanced features this experiment will have proved useful.

thanks
jon

Offline matthew

  • C= 64
  • **
  • Posts: 27
  • Karma: 2
    • View Profile
    • My Wikispace
Re: Blitzmax shader test
« Reply #6 on: March 23, 2009 »
It looks very good, I've just tried it on my computer running XP with an Intel card & it worked fine.  :updance:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Blitzmax shader test
« Reply #7 on: March 23, 2009 »
Works fine ATI X1650 :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Blitzmax shader test
« Reply #8 on: March 25, 2009 »
Works fine here too, GF 8800 GTS
Challenge Trophies Won: