[fixed]shader bug?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

[fixed]shader bug?

Post by agamemnus »

http://irrlicht.sourceforge.net/phpBB2/ ... 4&start=30

http://img140.imageshack.us/i/aproblem.png/

I can't get the water node to display properly. It uses the wrong texture pointer to display the water texture. I think this is probably a bug in how Irrlicht handles the ATI X series cards.. maybe it doesn't correctly test for missing features, I don't know.
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

But, this isn't part of the engine :o
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

stefbuet wrote:But, this isn't part of the engine :o
He made the conjecture that the problem lied with Irrlicht's handling of ATI X series cards.
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

One thing I noticed is that the console output stated "Could not create hlsl vertex shader."...

I cannot find anywhere on the internet where I can test whether my graphics card supports hlsl or not. Anyone have any ideas?

From wikipedia, graphics cards from X700 and up support Pixel Shader 2.0b and up. I am guessing my X600XT card can only support Pixel Shader 2.0 -- maybe that is the problem? It is stated in multiple areas the the X600XT fully supports DirectX 9.

Here are the graphics card specs, maybe that will help (not seeing anything about HLSL).
http://www.gpureview.com/Radeon-X600-XT-card-93.html
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

irrlicht can query supported hardware features (note that this can change according to the user driver. so directx and ogl can be different)

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=40497
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

I would rather use something that doesn't use any Irrlicht code, since Irrlicht already thinks I don't have "hlsl". Interestingly, I believe this card was designed for DirectX and Irrlicht thinks I have "glsl"...
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

can you post a little project that reproduce the bug with the standard irrlicht.dll under visual studio?.. so simple example code, like the irrlicht example about shader usage. possibly with a project file for compiling it under visual studio?

If you run the shader example demo and select directx 9. does the console output shows DIRECTX with hlsl or OpenGL with glsl?
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

It uses the wrong texture pointer to display the water texture
From what I see it's just that the shader didn't compile but shader input texture are still on the model and that's what you see. If the shader was compiled and running it would use texture informations but display other things.
This can happen if your graphic card is not new enougt to support the shader, or as you're using ATI card it can be a problem with the shader because ATI is much more strict than NVidia with shader syntax. Use GPU ShaderAnalyzer from AMD to find out if the problem's coming from your card or the shader.
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

REDDemon wrote:can you post a little project that reproduce the bug with the standard irrlicht.dll under visual studio?.. so simple example code, like the irrlicht example about shader usage. possibly with a project file for compiling it under visual studio?
The blood+water demo out of the package doesn't work.
If you run the shader example demo and select directx 9. does the console output shows DIRECTX with hlsl or OpenGL with glsl?
I compiled but got no .exe from it. I ran the .exe in the bin directory and selected both DirectX and openGL. No bugs or crashes.


----
stefbuet wrote:
It uses the wrong texture pointer to display the water texture
From what I see it's just that the shader didn't compile but shader input texture are still on the model and that's what you see. If the shader was compiled and running it would use texture informations but display other things.
No, it is using part of the skybox as the texture.
This can happen if your graphic card is not new enough to support the shader, or as you're using ATI card it can be a problem with the shader because ATI is much more strict than NVidia with shader syntax. Use GPU ShaderAnalyzer from AMD to find out if the problem's coming from your card or the shader.
I guess it's a syntax problem since the example shaders work fine. I'll do that, thanks.

Edit: Ok, tried it.

I got three different errors when I tried to compile: two truncation errors/warnings (which I was able to fix) and an "entrypoint not found" error:
error X3501: 'main': entrypoint not found
After fixing the truncation errors/warnings, the shader still failed to load.

I don't really know what to do. The Irrlicht shader example code, which works, gives me the same error.

Maybe that's not really a problem.

I tried to test with hlsl 1.1 (maybe that's what I have? I really don't know) but got this error:

Code: Select all

error X3539: ps_1_x is no longer supported; use /Gec in fxc to automatically upgrade to ps_2_0
error X3539: Alternately, fxc's /LD option allows use of the old compiler DLL
Not really sure what they are talking about here.

Anyway... could anyone remind me how to turn on Irrlicht notice/error messages? I turned them off ages ago and I forgot how to turn them back on.
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

you must check all supported drivers features and check for compability of the shaders. if irrlicht example works probably your problem is the shader that is not supported...
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

I can't test that fully though, because I can't compile the shaders b/c of error X3501.
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

you don't need to compile shaders for test if your driver is able to render shaders. you must be sure you have setted the correct PS and VS version in your shader material when you add a shader.

for example if you try to compile a glsl 1.0 shader probably you will get an error if you provide as parameter to the shader compiler a wrong version. for example glsl 4.0

anyway without a code that reproduce the bug we cannot help so much.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

I don't have any of those errors.

The code I'm testing is what's in the water shader of the blood & water zip file, as well as the example Irrlicht shaders (which work in the example). They all give error X3501.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Use a newer Irrlicht version or an older DirectX dll. And make use of the search button.
agamemnus
Posts: 283
Joined: Sun Jan 31, 2010 6:06 pm

Post by agamemnus »

I'm using 1.7.2.

After manually searching 54 pages in two threads, (since the search function doesn't specify which page, this is all I found on the subject:
BlindSide wrote:Yep, those errors usually indicate it's getting zero-length strings for the shaders. Glad you got it sorted.
I don't really know how that applies here.

An older DirectX dll? I don't think the DLL is the problem here. I think maybe the debugger is expecting some sort of extra code, since the example Irrlicht shaders work fine and don't give me any errors.

Edit: Ok, that was stupid. I changed the function pixelMain to "main"... now I am getting some decent errors that I can debug.. (edit2) or can't:
Unknown Error Compiler Shader
Last edited by agamemnus on Wed Mar 16, 2011 9:58 pm, edited 1 time in total.
Post Reply