XEffects - Reloaded - New Release (V 1.4)
-
- Posts: 199
- Joined: Wed Nov 29, 2006 4:07 am
-
- Posts: 18
- Joined: Sat Oct 03, 2009 7:14 am
- Location: Brisbane, Australia
- Contact:
I'm Having problems with running the XEffects examples. Every time I try to start one of them it will start loading and then crash.
Here's the output from when I try to run Example 1 (although not the full output which is over 620 lines ling):
Here's the output from when I try to run Example 1 (although not the full output which is over 620 lines ling):
Code: Select all
rory@macrohard:~/Programming/XEffects/Bin$ ./Example1
Welcome to the X-Platform Effect Wrapper Demo
Please select the driver type:
1 - OpenGL
2 - Direct3D9
1
Please select the ShadowMap resolution:
1 - 512x512
2 - 1024x1024
3 - 2048x2048
4 - 4096x4096
1
Please select the ShadowMap filtering:
1 - none
2 - 4 PCF
3 - 8 PCF
4 - 12 PCF
5 - 16 PCF
1
Irrlicht Engine version 1.6
Linux 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64
Creating X window...
Visual chosen: : 39
Using renderer: OpenGL 2.1.2
GeForce 7050 PV / nForce 630a/PCI/SSE2: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL version: 1.2
<580 lines of various loading messages>
Could not open file of texture: XEFFECTS_SM_512
XEffects: Please ignore previous warning, it is harmless.
FBO has one or several incomplete image attachments
FBO error
FBO incomplete
Could not open file of texture: XEFFECTS_SM_512
XEffects: Please ignore previous warning, it is harmless.
Segmentation fault
rory@macrohard:~/Programming/XEffects/Bin$
My website - Miscreant Software
It has trouble creating the render target. Try setting screenRTT to 512x512.
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
Yes but you must use EMT_TRANSPARENT_ALPHA_CHANNEL_REF. This basically means that it will be an on/off style transparency. If you use filtering it will still look nice and soft though. This is perfectly suited for leaves and grass strands.
This is shown in the first example with the floating XEffects logo cube.
Cheers
This is shown in the first example with the floating XEffects logo cube.
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
Ok thanks. The FPS will propably be horrible though, since im rendering a huge scene with thousands of grass quads.
Everything is possible, IF you know how.
Checkout my website for my upcoming game.(Currently on hold!)
http://www.projectbattle360.webege.com
Checkout my website for my upcoming game.(Currently on hold!)
http://www.projectbattle360.webege.com
I doubt it will be that bad since shadow maps aren't as badly affected by the scene node count as stencil shadows are. Most likely you will notice about half or a third the fps with it enabled, no matter how many grass quads there are.
Make sure to batch the grass quads since it's bad for performance in general to have many draw calls, this would make the shadows render faster too.
Make sure to batch the grass quads since it's bad for performance in general to have many draw calls, this would make the shadows render faster too.
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
Yes there are better ways to do this but they are not implemented currently. It would have been way easier if Irrlicht already supported CubeMaps but what can you do.
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: 288
- Joined: Wed Apr 16, 2008 1:45 am
- Contact:
I set the far value for a point light to a large number so it would act more like a sun but it then does not work well on shadows close by for some reason. Is there a way to change this so it works well in both instances, far away and near by with a large far value? A work around I was thinking of doing was making a point light near by the character to make the close by shadows look like they should then just have a spot light at 180 degrees up high to light up the rest of the map and give some shadows to it. Though I prefer having as few lights as possible since they do make an impact on the fps. Let me know if I am doing anything wrong, I copied most code from the point light example. Just changed the far value and made the light stationary for now.
EDIT:
Another thing I was wondering was why it increased my primitive count by 400,000. That may be normal I am just not quite sure why that happens. Without xeffects it is at 40,000 normally.
EDIT:
Another thing I was wondering was why it increased my primitive count by 400,000. That may be normal I am just not quite sure why that happens. Without xeffects it is at 40,000 normally.
-
- Posts: 91
- Joined: Sun Oct 19, 2008 5:29 pm
- Location: Valencia (Spain)
- Contact:
Hey BlindSide
I just finished a shadow system (like yours), using another system.
Instead of calculating all in render targets, calculating only the shadow and I make one pass, so you can use any material, whether sphere mapping, normal mapping or whatever.
This will increase performance and manages to cut the code.
Example
Your code for Depth pass:
Possible code for depth pass:
This is just to give you an idea.
Download my code and take a look if you want:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=36308
I just finished a shadow system (like yours), using another system.
Instead of calculating all in render targets, calculating only the shadow and I make one pass, so you can use any material, whether sphere mapping, normal mapping or whatever.
This will increase performance and manages to cut the code.
Example
Your code for Depth pass:
Code: Select all
for(u32 i = 0;i < ShadowNodeArraySize;++i)
{
if(ShadowNodeArray[i].shadowMode == ESM_RECEIVE || ShadowNodeArray[i].shadowMode == ESM_EXCLUDE)
continue;
const u32 CurrentMaterialCount = ShadowNodeArray[i].node->getMaterialCount();
core::array<irr::s32> BufferMaterialList(CurrentMaterialCount);
BufferMaterialList.set_used(0);
for(u32 m = 0;m < CurrentMaterialCount;++m)
{
BufferMaterialList.push_back(ShadowNodeArray[i].node->getMaterial(m).MaterialType);
ShadowNodeArray[i].node->getMaterial(m).MaterialType = (E_MATERIAL_TYPE)
(BufferMaterialList[m] == video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF ? DepthT : Depth);
}
ShadowNodeArray[i].node->OnAnimate(device->getTimer()->getTime());
ShadowNodeArray[i].node->render();
const u32 BufferMaterialListSize = BufferMaterialList.size();
for(u32 m = 0;m < BufferMaterialListSize;++m)
ShadowNodeArray[i].node->getMaterial(m).MaterialType = (E_MATERIAL_TYPE)BufferMaterialList[m];
}
Code: Select all
for(u32 i=0; i<meshArray.size(); ++i)
{
pVideo->setTransform(ETS_WORLD,meshArray[i]->getAbsoluteTransformation());
pVideo->setMaterial(depthMat);
for(u32 j=0; j<meshArray[i]->getMaterialCount(); ++j)
pVideo->drawMeshBuffer(meshArray[i]->getMesh()->getMeshBuffer(j));
}
Download my code and take a look if you want:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=36308
XEffects doesn't support point lights, Example 2 is just showing it can be done to an extent, but I don't recommend actually doing it that way. I'm guessing this is some sort of space game if you can get that close to the sun, otherwise if it is terrain-based you should definitely use a directional light for your shadows. Sun != point, Sun == directional because of it's enormous size in comparison to the earth.Insomniacp wrote:I set the far value for a point light to a large number so it would act more like a sun but it then does not work well on shadows close by for some reason. Is there a way to change this so it works well in both instances, far away and near by with a large far value? A work around I was thinking of doing was making a point light near by the character to make the close by shadows look like they should then just have a spot light at 180 degrees up high to light up the rest of the map and give some shadows to it. Though I prefer having as few lights as possible since they do make an impact on the fps. Let me know if I am doing anything wrong, I copied most code from the point light example. Just changed the far value and made the light stationary for now.
EDIT:
Another thing I was wondering was why it increased my primitive count by 400,000. That may be normal I am just not quite sure why that happens. Without xeffects it is at 40,000 normally.
If you really need a point light it will eventually be supported in the Irrlicht shadow system.
Ah but that will only work for Mesh/AnimatedMesh scene nodes.Possible code for depth pass:
I'm not sure what you mean by this, when I have time I will look at your code to see the difference.Instead of calculating all in render targets, calculating only the shadow and I make one pass, so you can use any material, whether sphere mapping, normal mapping or whatever.
One reason to calculate all using render targets is to get an additive lighting effect where the shadows are colored by the other lights that are not in shadow.
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: 91
- Joined: Sun Oct 19, 2008 5:29 pm
- Location: Valencia (Spain)
- Contact:
Is trueAh but that will only work for Mesh/AnimatedMesh scene nodes.
Just as this is achieved more quality. To my way get all the shadows are the same color, can be a problem if you want to get realistic shadows. It would be an alternative....an additive lighting effect...
I was watching a tutorial as creating points light with shadow maps.XEffects doesn't support point lights...
Do not use a cube map or anything like that (there are many render targets), with dual Paraboloid maps, so it should only be used 2 render targets instead of 6 (as in the case of the cube map).
It seems easy to do.
Bye