Author Topic: [PROCEDURAL] Cave (ps 2.0)  (Read 15655 times)

0 Members and 1 Guest are viewing this topic.

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4380
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #20 on: May 09, 2008 »
@hellfire:

same fx like rbz reported here.

card: NVIDIA GeFroce 7600 GT.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #21 on: May 09, 2008 »
An interesting bug :)
I use the z-component of the reflection-vector (which can be negative) as a fresnel-factor and take it ^12 to make it a bit shiny.
So - I thought - an even exponent should give a positive result, no matter what the sign is.
At least that's the case on ATI.
Nvidia, however, seems to use a very different approximation of pow() which is dropping negative at some point.
Negative factors don't work so well on colours, though ;)
Going to fix that later...
« Last Edit: May 09, 2008 by hellfire »
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4380
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #23 on: May 09, 2008 »
Thanks Benny. Thought it was only somewhat unprecise but Nvidia gives even NAN for pow() on negative numbers - good to know.
Reattached a (hopefully) fixed version.
« Last Edit: May 13, 2008 by hellfire »
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2717
  • Karma: 484
    • View Profile
    • http://www.rbraz.com/
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #24 on: May 10, 2008 »
Hmm, I know it's hard to hear this but it crashes here after precalc... :(

I wonder when shaders will be compatible everywhere  :-\



P4 2.8Ghz - Nvidia 6600GT
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #25 on: May 10, 2008 »
I my glsl manual it says this
Quote
genType pow (genType x, genType y)
  Returns x raised to the y power, i.e., x ^ y
  Results are undefined if x < 0.
  Results are undefined if x = 0 and y <= 0.
Even though, mathematically speaking, x need not be positive.

Jim
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17376
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #26 on: May 10, 2008 »
Crashes here too P4 3ghz, ATI X1650.

The screenshot looks exceptional.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #27 on: May 10, 2008 »
Oh dear, I've probably screwed something up, but at the moment I've got no idea what and where (runs fine here, also in debugger)...
Attached (up) a version which displays some debug-output.
Would be nice if someone could tell me where the crash happens.

« Last Edit: May 10, 2008 by hellfire »
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2717
  • Karma: 484
    • View Profile
    • http://www.rbraz.com/
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #28 on: May 10, 2008 »
Yeah, "test.zip" with debug info works like a charm, "test2.zip" crashes

It looks really cool

Take some karma for fixing it :)
Challenge Trophies Won:

Offline Deleter

  • C= 64
  • **
  • Posts: 72
  • Karma: 11
    • View Profile
    • Deleter's Rants
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #29 on: May 10, 2008 »
test works for me just fine, but it looks no where as cool as that screenshot. When I run it it just looks gray white and black, no cool colors

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17376
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #30 on: May 11, 2008 »
test works for me just fine, but it looks no where as cool as that screenshot. When I run it it just looks gray white and black, no cool colors

In that case it's fuxxored on your machine.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Deleter

  • C= 64
  • **
  • Posts: 72
  • Karma: 11
    • View Profile
    • Deleter's Rants
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #31 on: May 11, 2008 »
test works for me just fine, but it looks no where as cool as that screenshot. When I run it it just looks gray white and black, no cool colors

In that case it's fuxxored on your machine.

Yeah, just like the spiders entry...its all the in the shaders, stupid ati...maybe I should try updating mine...

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #32 on: May 12, 2008 »
This actually marks my first time seeing the algorithm implimented in real time! I'm just shocked at how you pulled off this advanced programming algorithm. Damn nice sir, DAMN nice.  :goodpost:
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #33 on: May 12, 2008 »
Thanks for testing and feedback!
Though, I've a bit lost track of what version is now running on which hardware...

Quote
When I run it it just looks gray white and black
That probably means you don't have shaders 2.0...
At least that's what it does on a geforce4mx: the driver successfully compiles the shader, but totally fails in activating the fragment program (and keeps in fixed-function-mode). The vertex program is emulated in software though.

Quote
"test.zip" with debug info works like a charm, "test2.zip" crashes
That's wicked since both version only differ in shaders.
Could you please post what the crashing version outputs into the console window?
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17376
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #34 on: May 12, 2008 »
Quote
When I run it it just looks gray white and black
That probably means you don't have shaders 2.0...

So does that mean that GLSL is not backwards compatible? I have shaders 3.0 here and get grey shapes. Same happens with Jim's entry too.

XTI X1650
Shockwave ^ Codigos
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #35 on: May 12, 2008 »
Quote
does that mean that GLSL is not backwards compatible? I have shaders 3.0 here
No, that's certainly not the case, ShaderModel 2 is just a subset of Model 3.
What I wrote above applies to old Geforces/Radeons (not supporting fragment programs or just Shader-Model 1.x): The driver exposes all functionality (all extensions are available) and the shader compiler is able to produce valid code, but the card just can't handle it in hardware.
In that case, Geforces don't activate the fragment program and just use parameters (coming from the Vertex-Shader) affecting the fixed-function pipeline for rendering - in my case that's just the vertex-colour (resulting in a grey gradient from front to back).
The same happens on ati with non-conform shader-code (the compiler won't produce code from the fragment-program and leaves the fixed-function-pipeline active on rendering) - there should be a message about that in the console-window...
If the shader-code exceeds the size-limit on shader2-hardware, ati falls back to software-rendering (I'm not quite sure what Nvidias does - this only applies to Geforce5xxx-based cards).
The vertex-program is seldom a problem since it can be emulated in software without such a big performance-penalty (mapped to sse/3dnow, just producing heavy bus-traffic).

What's the actual problem here is still a bit out of my understanding.
I've tested both versions on Radeon 9600 (Shader 2.0) & Geforce 7600 (Shader 3.0) and they both work fine. If the shader doesn't work on your Radeon, it's probably because of different driver version (I'm using Catalyst 8.4 from September 2007) which might include a somewhat different shader-compiler or just features new bugs...
A crash, however, is most probably caused by my sucking code ;)

Edit: Updated drivers to current version and can't see any difference, still it's not impossible that some other code-path for other/newer hardware might cause trouble of some kind...

« Last Edit: May 12, 2008 by hellfire »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17376
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #36 on: May 12, 2008 »
Thanks for the information. I have never tried shader language so it's all a bit of an enigma to me.

Strangely I tried running test2 again and this time it ran perfectly. Maybe there was something else interfering with it on my system as I have had a little bit of a clean-up tonight.

It looks really impressive, like wet stones. fantastic to look at.



Shockwave ^ Codigos
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #37 on: May 12, 2008 »
On my Vista, 8600GT the first post didn't have any colours, just grainy grey, it still looks cool so I didn't notice anything wrong.  test.exe works brilliantly, and makes the effect even better with the specular colours.  test2.exe crashes immediately.

Jim
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2717
  • Karma: 484
    • View Profile
    • http://www.rbraz.com/
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #38 on: May 13, 2008 »
Quote
"test.zip" with debug info works like a charm, "test2.zip" crashes
That's wicked since both version only differ in shaders.
Could you please post what the crashing version outputs into the console window?
After a fast precalc "test2.zip" crashes at position:4700~4900, and there's no console window opened  ???.
Challenge Trophies Won:

Offline hellfire

  • Sponsor
  • Pentium
  • *******
  • Posts: 1289
  • Karma: 466
    • View Profile
    • my stuff
Re: [PROCEDURAL] Cave (ps 2.0)
« Reply #39 on: May 13, 2008 »
Quote
there's no console window opened  Huh.
Oh, true... stupid me :whack:
Now attached a version that actually opens a console-window ;)
Moved all attachment to the first post for less confusion.
Also forgot to mention that "Cursor Up" moves faster...

Quote from: Deleter
When I run it it just looks gray white and black, no cool colors
Could you please tell what gfxboard, driver and os?

« Last Edit: May 13, 2008 by hellfire »
Challenge Trophies Won: