[fixed]TextureMatrix 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.
Kriolyth
Posts: 26
Joined: Wed Mar 26, 2008 6:59 pm
Location: Moscow, Russia

Post by Kriolyth »

Dorth wrote:errr, why not

Code: Select all

         if (different || TextureMatrix == b.TextureMatrix)
            return different;
         else
            different |= (*TextureMatrix != *b.TextureMatrix); 
Even better:

Code: Select all

         if (different || TextureMatrix == b.TextureMatrix)
            return different;
         else
            return (*TextureMatrix != *b.TextureMatrix); 
:)
The cake is a lie.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Have you tested this under the last build to see if it fix the transparent/reflection map problem in DX9? Is there any improvement on the reflections map and transparent/reflection in openGL?

The current problem is that the texture is reflected incorrectly in 1.4 (Was ok in 1.3.1) (Depending of the angle of the camera the reflection texture flips). Strangely in DX if using only reflection and not using the transparent of the surface the reflection map is working OK. In GL the texture is distorded and reflected in reverse (upside down).

I would really need that is fixed since I will need this on my project. The only alternative is to use shaders to create this.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

That has nothing to do with the current thread, christian ;)

If you need a good enviroment mapping shader there are lots at the NVidia Shader Library

PS hybrid, do you feel like implementing this fix yet?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Thanks Blindside.

I think (with my little knowledge) that the problem was related to the texture matrix transformation of the reflection, so I took a chance and asked.

Is there shaders that don't require Pixel Shaders v2.0+? I would like to reflect on low end hardware also.

For my project; I would like to have basic environnement mapping and diffuse mapping working on pre-PS V2 hardware and use .HLSL /.GLSL shaders for hardware supporting Pixel shader v2.0 (So when Pixel Shader 2.0 is detected, there will also be Normal maps/Specular maps available)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Is there shaders that don't require Pixel Shaders v2.0+?
Yes offcourse, a simple reflective texture mapping shader doesn't even need a pixel shader. You can just modify the texcoords in a vertex shader.
I think (with my little knowledge) that the problem was related to the texture matrix transformation of the reflection, so I took a chance and asked.
If you read the first post it would be obvious that this bug is about a crash caused by texture matrices, and nothing to do with graphical output.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
mk.1
Posts: 76
Joined: Wed Oct 10, 2007 7:37 pm

Post by mk.1 »

Any idea when this problem is solved? Trying to debug my project and it's getting on my nerves.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Which one exactly? This thread contains several bug reports...
mk.1
Posts: 76
Joined: Wed Oct 10, 2007 7:37 pm

Post by mk.1 »

Heap corruption by set/getTextureMatrix (for windows)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Yeah I would really like this one resolved too, it wouldn't hurt to try my method for a few revisions would it?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
gheft
Posts: 34
Joined: Mon Jul 30, 2007 4:11 am

Post by gheft »

sorry to bump an old thread but what is the status on this bug?

all I know is the line
tile->node->getMaterial(0).getTextureMatrix(0).setTextureScale (flip, 1.f);

gives me a corruption of the heap error with a breakpoint in ireferencecounted,h

is there a solution that doesn't involve recompiling irrlicht?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, you can just choose the proper runtime library when compiling your app. This should use the same heap then, and hence avoid corruptions.
The other solution, which I am currently investigating, is using the allocator as described by BlindSide.
gheft
Posts: 34
Joined: Mon Jul 30, 2007 4:11 am

Post by gheft »

compiling my app with /MD was not enough, I had to also recompile irrlicht with the same settings, and now it works.
So its probably a good idea to make it compatible with irrlichts default configuration.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

gheft wrote:I had to also recompile irrlicht with the same settings
Yes, that is the key. You need the Irrlicht.dll to use the same heap as your game.exe. The only way to do this is to make sure that they both use the same C runtime library.

Travis
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, I've applied the irrAllocator fix also for the 1.4.2 release!
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Yayayayayay :D

(Sorry can't contain my excitement :P )
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply