XEffects - Reloaded - New Release (V 1.4)
hmm OpenGL version in my GF7300GT have some problems with run this library. (with versione XeffectR1.3)
Could not open file or texture: XEFFECT_SM_1024
XEffect: please ignore previous warning....
FBO has one or several incomplete image attachments
FBO error
FBO incomplete
Could not open file or texture: XEFFECT_SM_1024
XEffect: please ignore previous warning....
but when i choose DirectX9 all working fine.
Could not open file or texture: XEFFECT_SM_1024
XEffect: please ignore previous warning....
FBO has one or several incomplete image attachments
FBO error
FBO incomplete
Could not open file or texture: XEFFECT_SM_1024
XEffect: please ignore previous warning....
but when i choose DirectX9 all working fine.
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
How do I change the shader directory in the new release? I want it to use the directory that I put into my project.
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
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
I'm also getting: ERROR cannot set render target.
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
How does the directional light work? I tried
but there was no light..
EDIT: figured it out, just need to change FOV to some high number like 90000*DEGTORAD
Code: Select all
effect->addShadowLight(SShadowLight(sunShadowDim, vector3df(0, 1000, 0), vector3df(0, 0, 0), //real sun
SColor(0, 200, 150, 150), 500.0f, 2000.0f, 90.0f * DEGTORAD, true));
EDIT: figured it out, just need to change FOV to some high number like 90000*DEGTORAD
There is no shader directory because all the default shaders are embedded in the source code.3DModelerMan wrote:How do I change the shader directory in the new release? I want it to use the directory that I put into my project.
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:
Try to use as small an FOV as possible to get better quality. For Orthogonal shadows the FOV is basically just the width and height of the view, so smaller view == better quality.ent1ty wrote:How does the directional light work? I triedbut there was no light..Code: Select all
effect->addShadowLight(SShadowLight(sunShadowDim, vector3df(0, 1000, 0), vector3df(0, 0, 0), //real sun SColor(0, 200, 150, 150), 500.0f, 2000.0f, 90.0f * DEGTORAD, true));
EDIT: figured it out, just need to change FOV to some high number like 90000*DEGTORAD
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
Hello, getting errors here on certain CD3D9HLSLMaterialRenderer::setVariable() calls.
I'm completely lost on this one. Running this on:
Any help on this one?
EDIT: it's working fine with EDT_OPENGL btw.
EDIT 2: fixed it by changing the following line in EffectCB.h
to:
I'm completely lost on this one. Running this on:
- Windows 7 Ultimate, Directx 11.
Running Irrlicht engine with EDT_DIRECT3D9.
NVIDIA Quadro FX 570M.
Using the VS_2_a and PS_2_a trick.
Having 3 shadow casting objects in my scene
Having 1 shadow casting light in my scene (+1 irrlicht light)
Having 1 shadow receiving object in my scene
Code: Select all
LightPos <-- Error setting float array for HLSL variable
MaxD
MAPRES
LightColour
screenX
screenY
LineStarts0
LineStarts1
LineStarts2
LineStarts3
LineEnds0
LineEnds1
LineEnds2
LineEnds3
mWorldViewProj
MaxD
mWorldViewProj
MaxD
mWorldViewProj
MaxD
screenX
screenY
LineStarts0
LineStarts1
LineStarts2
LineStarts3
LineEnds0
LineEnds1
LineEnds2
LineEnds3
mWorldViewProj
MaxD
mWorldViewProj
MaxD
mWorldViewProj
MaxD
mWorldViewProj
mWorldViewProj2
LightPos <-- Error setting float array for HLSL variable
EDIT: it's working fine with EDT_OPENGL btw.
EDIT 2: fixed it by changing the following line in EffectCB.h
Code: Select all
services->setVertexShaderConstant("LightPos", reinterpret_cast<f32*>(&lightPosOS).X, 4);
Code: Select all
services->setVertexShaderConstant("LightPos", reinterpret_cast<f32*>(&lightPosOS), 3);
Ah, nice find.
Some news on the Irrlicht implementation:
It's coming along nicely but you have to note some differences between the way XEffects and Irrlicht will work:
XEffects uses a single render target and renders multiple lights using a looping pass that renders the depth map and right after an additive shadow map overlay with the color of the light. This means that XEffects has both the shadowing and lighting responsibilities and that if something is not manually excluded from the scene it will be affected by this lighting also.
For the Irrlicht implementation it will be significantly different. It will render multiple lights into their own depth map in a previous pass and then do the shadow mapping as a transparent "darkening" layer with the ZBuffer intact, meaning it will only darken things and only the things that are supposed to receive shadows. I will probably restrict shadow receiving/casting to solid nodes at the start.
The main disadvantages/advantages of the 2 systems are:
XEffects:
Advantages:
- Because XEffects does the lighting also, it is capable of doing a realistic additive accumulative lighting system Basically it only shadows the color corresponding to the shadow casting light, and not everything, so you get realistic colored shadows (E.g. in the demo the RED light casts GREEN shadows and vice-versa).
- Only one shadow map for all lights (Less memory intensive).
Disadvantages:
- XEffects is more "intrusive", and needs to apply the lighting in a post process pass to the entire scene. This means that transparent scene nodes are difficult to render correctly and usually have to be excluded in some way from the scene's lighting. This also makes everything behind transparent scene nodes be free of lighting/shadows, which can look weird.
- It needs to re-use the same rendertarget in a loop, which can be bad for performance as the GPU has to wait for the previous pass to finish before it can continue with the next.
Irrlicht implementation:
Advantages:
- Faster because only shadow-receiving nodes have to be rendered and no lighting needs to be done (Only shadows).
- Keeps the ZBuffer from the scene intact so that the shadows only get drawn where they're supposed to be and reduces overdraw.
- Doesn't interfere with the rest of the scene so it's easy to use a lot of materials and transparency types and not have to manually exclude them.
- Much easier and straightforward to use.
- Will try to support point lights in the initial release or very soon after it, which will be a big improvement over XEffect's directional/spotlight only system.
- Probably a little faster because the GPU doesn't depend on a single shadow map when rendering the depth passes, therefore it can continue onto the next pass without waiting for the previous to finish.
Disadvantages:
- Only renders "Darkening" shadows with an ordinary color similar to the current stencil buffer system. This means no additive accumulative lighting.
- Multiple shadow maps so the memory usage is a bit higher.
This should about cover the differences. I want to have additive lighting in Irrlicht someday but it needs some thought about the lighting system, and for now I want to implement shadow maps without changing the interface so that it's easy for existing projects to switch between the shadow types.
Cheers
Some news on the Irrlicht implementation:
It's coming along nicely but you have to note some differences between the way XEffects and Irrlicht will work:
XEffects uses a single render target and renders multiple lights using a looping pass that renders the depth map and right after an additive shadow map overlay with the color of the light. This means that XEffects has both the shadowing and lighting responsibilities and that if something is not manually excluded from the scene it will be affected by this lighting also.
For the Irrlicht implementation it will be significantly different. It will render multiple lights into their own depth map in a previous pass and then do the shadow mapping as a transparent "darkening" layer with the ZBuffer intact, meaning it will only darken things and only the things that are supposed to receive shadows. I will probably restrict shadow receiving/casting to solid nodes at the start.
The main disadvantages/advantages of the 2 systems are:
XEffects:
Advantages:
- Because XEffects does the lighting also, it is capable of doing a realistic additive accumulative lighting system Basically it only shadows the color corresponding to the shadow casting light, and not everything, so you get realistic colored shadows (E.g. in the demo the RED light casts GREEN shadows and vice-versa).
- Only one shadow map for all lights (Less memory intensive).
Disadvantages:
- XEffects is more "intrusive", and needs to apply the lighting in a post process pass to the entire scene. This means that transparent scene nodes are difficult to render correctly and usually have to be excluded in some way from the scene's lighting. This also makes everything behind transparent scene nodes be free of lighting/shadows, which can look weird.
- It needs to re-use the same rendertarget in a loop, which can be bad for performance as the GPU has to wait for the previous pass to finish before it can continue with the next.
Irrlicht implementation:
Advantages:
- Faster because only shadow-receiving nodes have to be rendered and no lighting needs to be done (Only shadows).
- Keeps the ZBuffer from the scene intact so that the shadows only get drawn where they're supposed to be and reduces overdraw.
- Doesn't interfere with the rest of the scene so it's easy to use a lot of materials and transparency types and not have to manually exclude them.
- Much easier and straightforward to use.
- Will try to support point lights in the initial release or very soon after it, which will be a big improvement over XEffect's directional/spotlight only system.
- Probably a little faster because the GPU doesn't depend on a single shadow map when rendering the depth passes, therefore it can continue onto the next pass without waiting for the previous to finish.
Disadvantages:
- Only renders "Darkening" shadows with an ordinary color similar to the current stencil buffer system. This means no additive accumulative lighting.
- Multiple shadow maps so the memory usage is a bit higher.
This should about cover the differences. I want to have additive lighting in Irrlicht someday but it needs some thought about the lighting system, and for now I want to implement shadow maps without changing the interface so that it's easy for existing projects to switch between the shadow types.
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: 1691
- Joined: Sun May 18, 2008 9:42 pm
Is this actually going into the Irrlicht SDK release?
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