• Welcome to Dark Bit Factory & Gravity.
 

[PROCEDURAL] Cave (ps 2.0)

Started by hellfire, May 01, 2008

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

benny!

@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:

hellfire

#21
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...
Challenge Trophies Won:

benny!

[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

hellfire

#23
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.
Challenge Trophies Won:

Rbz

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:

Jim

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:

Shockwave

Crashes here too P4 3ghz, ATI X1650.

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

hellfire

#27
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.

Challenge Trophies Won:

Rbz

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:

Deleter

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

Shockwave

Quote from: Deleter 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

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

Deleter

Quote from: Shockwave on May 11, 2008
Quote from: Deleter 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

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...

Pixel_Outlaw

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:

hellfire

Thanks for testing and feedback!
Though, I've a bit lost track of what version is now running on which hardware...

QuoteWhen 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:

Shockwave

Quote from: hellfire on May 12, 2008
QuoteWhen 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:

hellfire

#35
Quotedoes 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...

Challenge Trophies Won:

Shockwave

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:

Jim

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:

Rbz

Quote from: hellfire on May 12, 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:

hellfire

#39
Quotethere'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: DeleterWhen I run it it just looks gray white and black, no cool colors
Could you please tell what gfxboard, driver and os?

Challenge Trophies Won: