Faulty shader system

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.
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Faulty shader system

Post by omaremad »

This has been driving me mad for over a year so im putting it as a bug.
It appears no matter how many sampler2d i put in my shader only the first one picks up Material 0 from irrlicht while the second one also picks up material zero and not material 1.

This has restriced my shader to using one texture making them very boring.

maybe it is my codes fault if so please give me example code to load two textures into the shader

This is both in Hlsl and glsl

if i get this working the hdr effect should be done
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

I don't know about HLSL, but for GLSL it is an irrlicht bug for which I have a patch for.
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

can i please have the patch
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

can i please have the patch
Sure, just let me dig it up for you :)
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

Hmm, I don't see a way to attach a file here...
Send me a PM with your mail so that I can mail it to you
Guest

Post by Guest »

post it on the

http://pastebin.com/

and give me the link

or use this and give me the link

http://www.megaupload.com/(thanks to dawasw for the link)
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

Nevermind, I 've put it on my site. Get it here.
Last edited by mandrav on Sat Jan 14, 2006 4:56 pm, edited 1 time in total.
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

More info:

As I said, this is only for GLSL and the OpenGL driver. It's not a 100% correct fix, in the sense that it could be done better (the COpenGLSLMaterialRenderer part).
Also note that I have pumped MATERIAL_MAX_TEXTURES to 8. You might want to lower it to 4 to make it compatible with most graphics cards...
Guest

Post by Guest »

THanks alot
Guest

Post by Guest »

How do i apply the patch

plz explain the changes so Niko implements them
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

Anonymous wrote:plz explain the changes so Niko implements them
Explain what? The patch file is straightforward and usable against irrlicht 0.14.
The bug is that irrlicht doesn't set correctly integer shader constants (like sampler2d). This patch adds quick'n'dirty support for it (that's what could be done better).
Guest

Post by Guest »

i think he wanted to know >how< to apply the patch.

if you have linux, you can use the "patch" command. if you use windows, you have to search for the win32 version of patch.

but i did this for you - here is the link:

http://www.fsci.fuk.kindai.ac.jp/aftp/p ... ff-w32.zip

then you have to open the windows command line tool cmd.exe and then type patch.exe and then you see on how to use it :)

see you!
Guest

Post by Guest »

thanx gfx but the patch fails with all options it would be better to just send the .cpp over pastebin
Guest

Post by Guest »

got it patched but still doesnt work can any one give me a demo with code
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

Anonymous wrote:got it patched but still doesnt work can any one give me a demo with code
What does your shader callback look like?
Post Reply