XEffects - Reloaded - New Release (V 1.4)
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
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
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
I got a trouble.
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
- 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
-
- Posts: 70
- Joined: Tue Oct 28, 2008 12:59 pm
Re: I got a trouble.
Great! You can upload your source code? I and somebody need your source code fix bug. Thank you.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
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
-
- Posts: 70
- Joined: Tue Oct 28, 2008 12:59 pm
-
- Posts: 10
- Joined: Sat Nov 20, 2010 10:48 pm
- Location: Poland, Europe
- Contact:
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:
and changed it to this:
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?
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);
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);
I still haven't found a solution for the other problem - does anyone know how to make anti-aliasing work in D3D9?
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
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 10
- Joined: Sat Nov 20, 2010 10:48 pm
- Location: Poland, Europe
- Contact:
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:
Here's the code fragment:
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?
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:
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);
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?
Hi DarkMark, you have to use TRANSPARENT_ALPHA_CHANNEL_REF, transparency is not supported with TRANSPARENT_ALPHA_CHANNEL.
Cheers
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Shadow problem
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.
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...