XEffects - Reloaded - New Release (V 1.3)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Postby Nova » Thu Sep 23, 2010 10:47 am

Hi everyone,

I am trying to integrate XEffects to my project but having some troubles with my custom materials. I've read several pages from this post and came to the understanding that XEffects isn't supposed to mess with my materials but simply add the shadows "on top".

My materials are removed though and simply replaced with a solid white color.
Image
There are only two XEffects/Shader related errors in the console (seen above). The "error X3025" one also shows without XEffects and the scene still renders properly. So I discarded it as irrelevant.

This is a shader example. It's for the main dude (I omitted the variable/struct declaration for brevity):
Code: Select all
VS_OUTPUT vs_main(VS_INPUT In)
{
    VS_OUTPUT Out;

    Out.Pos         = mul( In.Pos, WorldViewProj );
    Out.TCoords     = In.TCoords;
    Out.light        = dot(normalize(mul( In.Normal, WorldViewProj )),normalize( float3(1,1,0)))/ 2 + 0.5;
    Out.light         = 1- Out.light;
    return Out;
}

float4 ps_main( float4 inDiffuse:  COLOR0,
               float2 inTCoords:  TEXCOORD0,
               float inLight:      TEXCOORD1
         ) : COLOR0
{
   //return float4(1,0,0,1);
   float4 color = tex2D( Tex0, inTCoords );

   float2 lookup = float2 ( inLight, LevelProgress );
   
   float4 lookupCol = tex2D( Tex1, lookup ) * 3;

   color = lookupCol * color;

   if( Anaglyph == 1 )
   {
      float itensity = dot( color, float4( 0.299, 0.587, 0.184, 0 ) );
      color.rgb = itensity.xxx;
   }

   return color;
}


XEffects is initialized like this:
Code: Select all
XEffectHandler = new EffectHandler( Env::Device, Env::Driver->getScreenSize(), false, true, false );
XEffectHandler->setAmbientColor( video::SColor( 255, 32, 32, 32 ) );


The effect also occurs when I don't have any shadowLights or shadowNodes in my scene.

Graphics Card: ATI Radeon HD 5700
Device: DirectX 9

I already recompiled the engine and there are no further shader errors.
In case its relevant, the graphics engine and xeffects are initialized in a seperate project which is statically linked to my bootstrapper, which also loads the game.dll. Don't think this causes the mess though since everything is handled in the engine lib.

I hope someone can help, I would really like to add those shadows to my game :-)
Nova
Competition winner
 
Posts: 99
Joined: Mon May 09, 2005 10:32 am

Postby BlindSide » Thu Sep 23, 2010 8:57 pm

Can you place a breakpoint somewhere after XEffects->update() and make sure that the materials are getting set back to their correct values? What does your draw loop look like?

Also, what are you doing for the terrain, is it excluded from light calculations?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2797
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby Nova » Fri Sep 24, 2010 12:33 am

:oops: Oh boy this is a dumb one.
The objects are loaded from a xml file which also stores the materialId.
With XEffects my custom materials now get new materialIds and therefore the old ones in the xml do not point to the correct material anymore.

For the level I iterate over all custom materials and apply them via the name I gave them in my engine. Thats why they got the correct material Id.

Sorry. Stupid mistake.
Nova
Competition winner
 
Posts: 99
Joined: Mon May 09, 2005 10:32 am

Postby smittix » Sun Sep 26, 2010 7:49 am

Does this shadow mapping method currently work with large scale scenes, like terrain covered in foliage?
smittix
 
Posts: 3
Joined: Sun Sep 26, 2010 7:46 am

Postby Elvenfighter » Sat Oct 02, 2010 4:06 pm

I'm having a trouble with EffectHandler::update() method.
With ISceneManager I was using this:

Code: Select all
       //this irr::core::rect<s32> viewRect was changing during runtime,
       //because the window, which was attached to irrlicht device also was able
       //to change its size
       //this is done because I want the aspect ratio stay unchanged
    driver->setViewPort(this->viewRect);
       //so next line displayed the rectangle with precalculated offsets
       //in resulting window
    smgr->drawAll();
       //aspect ratio was unharmed and the picture was undistorted


Now I'm using this
Code: Select all
    driver->setViewPort(this->viewRect);
    effect->update();


but the picture stretches all around the window, and distorts. And it is required that aspect ratio stays the same

can you solve this for me?
Elvenfighter
 
Posts: 1
Joined: Sat Oct 02, 2010 3:30 pm

Postby AW111 » Fri Oct 08, 2010 9:32 pm

I've isolated the "tinting" problem I was having and it's clearly caused by something in XEffects - at certain angles, any meshes added using addMeshSceneNode are tinted with the "ClearColour", so that they appear as various shades of that color like a black-and-white photograph except in shades of the ClearColour. This only occurs when XEffects is enabled, only at certain viewing angles, and only with nodes added using addMeshSceneNode - not with nodes using addTerrainSceneNode, nor my own custom nodes.
I'm hoping someone else has seen this type of effect and knows how to solve it. I can post screenshots if that's necessary.
I don't think I changed anything in XEffects' code except re-adding the foam effect in the shader and changing the color of the water in the same shader.
AW111
 
Posts: 82
Joined: Fri Jul 16, 2010 4:49 pm

Postby AW111 » Wed Oct 27, 2010 6:39 pm

I would like to modify the water shader so that I can use an undulating water surface to simulate waves and yet still have the refraction effects of the current shader. I assume that a specific texture could be defined as the water surface, and the shader would act on any fragment which had that texture? Please bear with me - I don't have much knowledge of shaders at all.
AW111
 
Posts: 82
Joined: Fri Jul 16, 2010 4:49 pm

Postby BlindSide » Thu Oct 28, 2010 8:41 am

undulating water surface to simulate waves


I'm not sure I get this, can you explain more clearly? I think it's non-trivial to not have a flat plane as the water surface using this method.

Btw, do you own a Toyota? :wink:
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2797
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby AW111 » Thu Oct 28, 2010 4:42 pm

BlindSide wrote:
undulating water surface to simulate waves


I'm not sure I get this, can you explain more clearly? I think it's non-trivial to not have a flat plane as the water surface using this method.
Btw, do you own a Toyota? :wink:



I just meant using the shader in conjunction with geometry-based water surfaces - normally, an animated mesh is used to simulate waves, waterfalls, etc, and I would need this type of thing. I like XEffects' refraction effect, but I'd need to use it on actual geometry so that it works on specific polygons that have a texture that represents the water surface -- e.g., if I have a river which cascades downwards at several points, the water surface is going to exist at varying Y coords rather than always at the same elevation. I assume I could mark individual triangles as "water" by using a specific texture, and then modify the shader so that it operates on this texture rather than a specific Y coord.
AW111
 
Posts: 82
Joined: Fri Jul 16, 2010 4:49 pm

Postby BlindSide » Sat Oct 30, 2010 7:08 am

AW111 wrote:
BlindSide wrote:
undulating water surface to simulate waves


I'm not sure I get this, can you explain more clearly? I think it's non-trivial to not have a flat plane as the water surface using this method.
Btw, do you own a Toyota? :wink:



I just meant using the shader in conjunction with geometry-based water surfaces - normally, an animated mesh is used to simulate waves, waterfalls, etc, and I would need this type of thing. I like XEffects' refraction effect, but I'd need to use it on actual geometry so that it works on specific polygons that have a texture that represents the water surface -- e.g., if I have a river which cascades downwards at several points, the water surface is going to exist at varying Y coords rather than always at the same elevation. I assume I could mark individual triangles as "water" by using a specific texture, and then modify the shader so that it operates on this texture rather than a specific Y coord.


But that defeats the novelty of having a screen-space water effect. You should just use another solution like sio2 or elvman's reflective/refractive water shaders.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
BlindSide
Admin
 
Posts: 2797
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby Winspy » Fri Nov 26, 2010 2:48 pm

I very like water effect!But my water wave is not moving, how to get the wave moving up?
Winspy
 
Posts: 1
Joined: Fri Apr 30, 2010 1:56 pm

Postby Belajar » Sun Nov 28, 2010 3:37 pm

i was recompile irrlicht.dll with DirectX SDK june 2010..
but it still not working..

when i tried to compile XEffect.sln , it gives me error like this

Code: Select all
DIRECT3D9 Driver was not compiled into this dll. Try another one.



Which DirectX sdk series that suitable for XEffect..?
Belajar
 
Posts: 15
Joined: Mon Nov 15, 2010 3:50 am

Postby Belajar » Wed Dec 01, 2010 4:18 am

mmm...or anyone that already build irrlicht.dll in MSCV..
enlightening me please..:D
Belajar
 
Posts: 15
Joined: Mon Nov 15, 2010 3:50 am

Postby ACE247 » Wed Dec 01, 2010 6:16 am

Ok so here's a Recompiled MSVC 2008 Irrlicht 1.7.2 dll
Works fine for me. :)
Irrlicht 1.7.2 Dll
H8L6L5M4G3H5M7N8S7N9O1R8J1P5M7N9O4P2Q5R6T7U4M3N8X6S5T8W (If you want the secret, why not 'TRY' decrypting it? )
This Door's lock doesn't need a key, the Lock is the key to open the Lock and you don't know how to turn the key...
Link: My Blog :)
User avatar
ACE247
 
Posts: 695
Joined: Tue Mar 16, 2010 12:31 am
Location: Namibia

Postby Belajar » Wed Dec 01, 2010 2:37 pm

ACE247 wrote:Ok so here's a Recompiled MSVC 2008 Irrlicht 1.7.2 dll
Works fine for me. :)
Irrlicht 1.7.2 Dll


mmm..when i tried to compile irrlicht 1.7.2 with the with your dll, it gives me error like this...

Code: Select all
First-chance exception at 0x100c5410 in 07.Collision.exe: 0xC0000005: Access violation reading location 0x0000000c.
Unhandled exception at 0x100c5410 in 07.Collision.exe: 0xC0000005: Access violation reading location 0x0000000c.
The program '[948] 07.Collision.exe: Native' has exited with code 0 (0x0).
Belajar
 
Posts: 15
Joined: Mon Nov 15, 2010 3:50 am

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 0 guests