XEffects - Reloaded - New Release (V 1.4)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Will the raytracing work with meshes (not just spheres)? And also, does it do shadows?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
bayofxyz
Posts: 5
Joined: Sun Sep 28, 2008 5:58 pm

I got a trouble.

Post by bayofxyz »

Is there anyone got trouble like me?
- all of texture that I draw as button are invert(they are "unknow" button).
- Text font changed(noticed at green), I can't read them :p
Image
tinhtoitrangtay
Posts: 70
Joined: Tue Oct 28, 2008 12:59 pm

Re: I got a trouble.

Post by tinhtoitrangtay »

bayofxyz wrote:Is there anyone got trouble like me?
- all of texture that I draw as button are invert(they are "unknow" button).
- Text font changed(noticed at green), I can't read them :p
Image
Great! You can upload your source code? I and somebody need your source code fix bug. Thank you.
ACE247
Posts: 704
Joined: Tue Mar 16, 2010 12:31 am

Post by ACE247 »

Can someone explain what this has to do with XEffects?
Tihtinen
Posts: 76
Joined: Fri Jan 08, 2010 3:12 pm
Location: Finland

Post by Tihtinen »

Actually that happens in XEffects in OpenGL. I had similar problems (though it has almost been a year since then and I don't know if it has been fixed). Read it and the solution here: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=38356
bayofxyz
Posts: 5
Joined: Sun Sep 28, 2008 5:58 pm

Post by bayofxyz »

Wow, Thank you for solution :D
tinhtoitrangtay
Posts: 70
Joined: Tue Oct 28, 2008 12:59 pm

Post by tinhtoitrangtay »

bayofxyz wrote:Wow, Thank you for solution :D
Hi bayofxyz! You can upload your project using Xeffects. Thank you.
DarkMarkZX
Posts: 10
Joined: Sat Nov 20, 2010 10:48 pm
Location: Poland, Europe
Contact:

Post by DarkMarkZX »

I managed to get around the problem with no shadows being cast by nodes with EMT_TRANSPARENT_ALPHA_CHANNEL_REF material type in Direct3D9. To keep it short, i found the following piece of code in EffectHandler.cpp:

Code: Select all

		DepthT = gpu->addHighLevelShaderMaterial(
			sPP.ppShader(SHADOW_PASS_1V[shaderExt]).c_str(), "vertexMain", video::EVST_VS_2_0,
			sPP.ppShader(SHADOW_PASS_1PT[shaderExt]).c_str(), "pixelMain", video::EPST_PS_2_0,
			depthMC, video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
and changed it to this:

Code: Select all

		DepthT = gpu->addHighLevelShaderMaterial(
			sPP.ppShader(SHADOW_PASS_1V[shaderExt]).c_str(), "vertexMain", video::EVST_VS_2_0,
			sPP.ppShader(SHADOW_PASS_1P[shaderExt]).c_str(), "pixelMain", video::EPST_PS_2_0,
			depthMC, video::EMT_SOLID);
It's not perfect though, but satisfactory.

I still haven't found a solution for the other problem - does anyone know how to make anti-aliasing work in D3D9?
Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

But DarkMarkZX, that won't support on/off transparency, it will just draw the whole scene node regardless of the alpha on the texture. I think you need to check your materialTypeParam (In the SMaterial struct) as it controls the threshold with which an object is drawn or not based on the alpha value, perhaps this value is too low/high and is causing issues with the current alpha values you are using?

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
DarkMarkZX
Posts: 10
Joined: Sat Nov 20, 2010 10:48 pm
Location: Poland, Europe
Contact:

Post by DarkMarkZX »

Thanks for the quick reply!
For testing purpose. I restored the original EffectHandler.cpp and created a simple box mesh with a partly transparent texture only to find out that the shadow it casts is completely wrong:
Image

Here's the code fragment:

Code: Select all

	node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("Data/cube.X"));
	node->setMaterialTexture(0, driver->getTexture("Data/test.png"));
	node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
	node->setScale(core::vector3df(0.5f, 0.5f, 0.5f));
	node->getMaterial(0).NormalizeNormals = true;
	node->setPosition(core::vector3df(50,50,100));
	effect->addShadowToNode(node, EFT_NONE, ESM_BOTH);
And here's the textured model:
http://www.sendspace.com/file/uwod17

I tried setting materialTypeParam to different values, but doesn't seem to change anything. What am I doing wrong?
Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hi DarkMark, you have to use TRANSPARENT_ALPHA_CHANNEL_REF, transparency is not supported with TRANSPARENT_ALPHA_CHANNEL.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
AW111
Posts: 82
Joined: Fri Jul 16, 2010 4:49 pm

Shadow problem

Post by AW111 »

Does XEffects ever use per-triangle shadowing (rather than the more realistic pixel-esque patterns)? It didn't used to do that in my program and I didn't think it was ever supposed to, but for some reason my program now only has shadowing on a triangle-by-triangle basis. At first I thought I had mistakenly enabled the default Irrlicht shadowing, but explicitly disabling it didn't clear up the problem. I would add that it clearly seems to be XEffects doing it, since changing the shadow resolution for XEffects changes the way the shadows are drawn - but they are always drawn per-triangle regardless.
Last edited by AW111 on Wed Mar 23, 2011 8:58 pm, edited 1 time in total.
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

Lighting is per vertex.
Shadowing is per pixel, it can't be per vertex with shadow maps, it's a post process effect! (not including depth buffer)
AW111
Posts: 82
Joined: Fri Jul 16, 2010 4:49 pm

Post by AW111 »

I've found my problem, although I'm not sure how to solve it - I was using enormous distances for the "nearplane" and "farplane" values for the light representing the sun, since I'm using a large landscape rather than a small room (as in the XEffects demos). Reducing the scale greatly improves the shadowing, but the sun is far too close to the landscape now. Any suggestions? I suppose I'd need a variable-scale (LOD) shadowing system...
stefbuet
Competition winner
Posts: 495
Joined: Sun Dec 09, 2007 4:13 pm
Location: france

Post by stefbuet »

There are multiple solutions for this problem, using for exemple more than 1 shadow map per light : Cascaded Shadow Mapping, Perspective Shadow Mapping... I have never implemented those thought, you can study all that mostly in GPU gems books. XEffect dosn't provide such solution for now.
Post Reply