XEffects - (Indoor Soft-Shadows + Post-Processing)
hi
about using your code:
in the example.cpp there is a commented strings for the terrain, if i do same as there i see only black screen
i think i must attach a lighnode to effect, but in your code there are onle GetLightNode (none SetLightNode), and there are SetLightPosition and SetLightTarget, but for any values it doesn't work:(
can you explain how to attach shadows to terrain?
Thanks
about using your code:
in the example.cpp there is a commented strings for the terrain, if i do same as there i see only black screen
i think i must attach a lighnode to effect, but in your code there are onle GetLightNode (none SetLightNode), and there are SetLightPosition and SetLightTarget, but for any values it doesn't work:(
can you explain how to attach shadows to terrain?
Thanks
This is very (VERY) nice, I'm sure it'll come useful in some future project.
Now as I see you've read the crysis paper how about SSAO. You already have a framework in place to render a depth texture, the rest is a sort of post processing pass, it's well described here http://rgba.scenesp.org/iq/computer/art ... o/ssao.htm
and alternatively Ysaneya proposes some nice approximation in his dev journal at gamedev.net, but I'm sure you already knew both.
Anyway this is prety great as it is, thanks!
Now as I see you've read the crysis paper how about SSAO. You already have a framework in place to render a depth texture, the rest is a sort of post processing pass, it's well described here http://rgba.scenesp.org/iq/computer/art ... o/ssao.htm
and alternatively Ysaneya proposes some nice approximation in his dev journal at gamedev.net, but I'm sure you already knew both.
Anyway this is prety great as it is, thanks!
Yes I do know both and I'm working on it right now
I've already integrated an easy to use post-processing facility into this wrapper that can stack effects one after the other. Just needs some tweaking.
@sp00n: Could you make a small test case without any irrelevant code (Just the terrain and some models) that showcases this problem. I would be happy to look at the code of this and sort out any problems you may have.
Cheers
I've already integrated an easy to use post-processing facility into this wrapper that can stack effects one after the other. Just needs some tweaking.
@sp00n: Could you make a small test case without any irrelevant code (Just the terrain and some models) that showcases this problem. I would be happy to look at the code of this and sort out any problems you may have.
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
Nice, I've tried it and it runs pretty fast on my... quadcore system +geforce 8800
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
I....want it....Virion wrote:Nice, I've tried it and it runs pretty fast on my... quadcore system +geforce 8800
Hows the SSAO going? I think there's some errors with my eye-rays and projections (again) and my attempts at solving them failed.
EDIT: Great stuff! I've seen your blog and noticed you've got your SSAO working. Waiting for it...
:)heers.
hi,
i was wondering if you plan to implent directional lighting too somewhen
greetings,
Halan
i was wondering if you plan to implent directional lighting too somewhen
greetings,
Halan
My Blog: http://www.freakybytes.org
Directional can already be done pretty easily. Just create an orthogonal projection matrix using Matrix4::buildProjectionMatrixOrthoLH() and set this as the light camera's projection matrix using effect->getLightCamera()->setProjectionMatrix().
Piece of cake, huh?
Piece of cake, huh?
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
Additional light sources
Im wondering if maybe u could add support for additional lightsources or give me some directions on where and what in the shaders to change(if that hasnt been added already, cant see anywhere in this post that it has).
This would be a nice feature for our project that im working on for school, we are making a game( can check it out at http://fuelinjected.se ).
Thx for the help
Hi BlindSide, first of nice work with the shadow effects .BlindSide wrote:Sorry that is difficult without editing the actual shader code, and also it is limited by hardware. For Shader model 3 it will be easy to have lots of lights though. Shader model 2 you can have a few lights but not over 4PCF quality.
Anyway this will require some small modifications to the shader.
Im wondering if maybe u could add support for additional lightsources or give me some directions on where and what in the shaders to change(if that hasnt been added already, cant see anywhere in this post that it has).
This would be a nice feature for our project that im working on for school, we are making a game( can check it out at http://fuelinjected.se ).
Thx for the help
-
- Posts: 86
- Joined: Thu Feb 14, 2008 7:30 pm
- Location: Portugal
hi.
1st of all, congratz for the nice work.
i am trying to compile u'r example program in linux, and since u don't include a make file i tryed to create one based on the make files from the irrlicht examples, and it is giving out some errors and i am not shure what am i doing wrong.
heres how the make file looks like:
# Makefile for Irrlicht Examples
# It's usually sufficient to change just the target name and source file list
# and be sure that CXX is set to a valid compiler
Target = xeffects
Sources = Example.cpp
# general compiler settings
CPPFLAGS = -I../../include -I/usr/X11R6/include
CXXFLAGS = -O3 -ffast-math
#CXXFLAGS = -g -Wall
#default target is Linux
all: all_linux
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
# target specific settings
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
all_win32 clean_win32: SUF=.exe
# name of the binary - only valid for targets which set SYSTEM
DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
all_linux all_win32:
$(warning Building...)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
clean: clean_linux clean_win32
$(warning Cleaning...)
clean_linux clean_win32:
@$(RM) $(DESTPATH)
.PHONY: all all_win32 clean clean_linux clean_win32
and here is the error it is giving:
Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
CShaderPre.h:10: error: extra qualification ‘CShaderPreprocessor::’ on member ‘removeShaderDefine’
make: *** [all_linux] Error 1
i tryed to comment line 10 with void CShaderPreprocessor::removeShaderDefine(const irr::core::stringc name); in Cshaderpre.h to see if i could understand what was going on and the error it gives after that is this:
Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
/tmp/ccGU9V01.o: In function `main':
Example.cpp:(.text+0x332): undefined reference to `effectHandler::effectHandler(irr::IrrlichtDevice*, irr::core::dimension2d<int>)'
Example.cpp:(.text+0x4aa): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x6b7): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x813): undefined reference to `effectHandler::setMaxShadowDistanceFromLight(unsigned int)'
Example.cpp:(.text+0x9db): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0x9e6): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0x9f6): undefined reference to `effectHandler::setShadowDarkness(float)'
Example.cpp:(.text+0xae2): undefined reference to `effectHandler::update()'
Example.cpp:(.text+0xb8a): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0xb95): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0xbaa): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
collect2: ld returned 1 exit status
make: *** [all_linux] Error 1
now, i admit i am newbie to irr programing so pls don't hit me too hard because of the question.
1st of all, congratz for the nice work.
i am trying to compile u'r example program in linux, and since u don't include a make file i tryed to create one based on the make files from the irrlicht examples, and it is giving out some errors and i am not shure what am i doing wrong.
heres how the make file looks like:
# Makefile for Irrlicht Examples
# It's usually sufficient to change just the target name and source file list
# and be sure that CXX is set to a valid compiler
Target = xeffects
Sources = Example.cpp
# general compiler settings
CPPFLAGS = -I../../include -I/usr/X11R6/include
CXXFLAGS = -O3 -ffast-math
#CXXFLAGS = -g -Wall
#default target is Linux
all: all_linux
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
# target specific settings
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
all_win32 clean_win32: SUF=.exe
# name of the binary - only valid for targets which set SYSTEM
DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)
all_linux all_win32:
$(warning Building...)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)
clean: clean_linux clean_win32
$(warning Cleaning...)
clean_linux clean_win32:
@$(RM) $(DESTPATH)
.PHONY: all all_win32 clean clean_linux clean_win32
and here is the error it is giving:
Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
CShaderPre.h:10: error: extra qualification ‘CShaderPreprocessor::’ on member ‘removeShaderDefine’
make: *** [all_linux] Error 1
i tryed to comment line 10 with void CShaderPreprocessor::removeShaderDefine(const irr::core::stringc name); in Cshaderpre.h to see if i could understand what was going on and the error it gives after that is this:
Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
/tmp/ccGU9V01.o: In function `main':
Example.cpp:(.text+0x332): undefined reference to `effectHandler::effectHandler(irr::IrrlichtDevice*, irr::core::dimension2d<int>)'
Example.cpp:(.text+0x4aa): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x6b7): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x813): undefined reference to `effectHandler::setMaxShadowDistanceFromLight(unsigned int)'
Example.cpp:(.text+0x9db): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0x9e6): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0x9f6): undefined reference to `effectHandler::setShadowDarkness(float)'
Example.cpp:(.text+0xae2): undefined reference to `effectHandler::update()'
Example.cpp:(.text+0xb8a): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0xb95): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0xbaa): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
collect2: ld returned 1 exit status
make: *** [all_linux] Error 1
now, i admit i am newbie to irr programing so pls don't hit me too hard because of the question.
-
- Posts: 86
- Joined: Thu Feb 14, 2008 7:30 pm
- Location: Portugal
is this the line or did i changed the wrong one?
i changed the line:
void CShaderPreprocessor::removeShaderDefine(const irr::core::stringc name);
to:
void removeShaderDefine(const irr::core::stringc name);
but the result is the same error has comenting the entire line !!!!
Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
/tmp/ccgR1Y1W.o: In function `main':
Example.cpp:(.text+0x332): undefined reference to `effectHandler::effectHandler(irr::IrrlichtDevice*, irr::core::dimension2d<int>)'
Example.cpp:(.text+0x4aa): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x6b7): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x813): undefined reference to `effectHandler::setMaxShadowDistanceFromLight(unsigned int)'
Example.cpp:(.text+0x9db): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0x9e6): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0x9f6): undefined reference to `effectHandler::setShadowDarkness(float)'
Example.cpp:(.text+0xae2): undefined reference to `effectHandler::update()'
Example.cpp:(.text+0xb8a): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0xb95): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0xbaa): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
collect2: ld returned 1 exit status
make: *** [all_linux] Error 1
it looks like the 1st error was something else and probably solved with what u sugested and this error to be for some other reason :/
i changed the line:
void CShaderPreprocessor::removeShaderDefine(const irr::core::stringc name);
to:
void removeShaderDefine(const irr::core::stringc name);
but the result is the same error has comenting the entire line !!!!
Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
/tmp/ccgR1Y1W.o: In function `main':
Example.cpp:(.text+0x332): undefined reference to `effectHandler::effectHandler(irr::IrrlichtDevice*, irr::core::dimension2d<int>)'
Example.cpp:(.text+0x4aa): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x6b7): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x813): undefined reference to `effectHandler::setMaxShadowDistanceFromLight(unsigned int)'
Example.cpp:(.text+0x9db): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0x9e6): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0x9f6): undefined reference to `effectHandler::setShadowDarkness(float)'
Example.cpp:(.text+0xae2): undefined reference to `effectHandler::update()'
Example.cpp:(.text+0xb8a): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0xb95): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0xbaa): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
collect2: ld returned 1 exit status
make: *** [all_linux] Error 1
it looks like the 1st error was something else and probably solved with what u sugested and this error to be for some other reason :/