CLensFlaresSceneNode - need some help
CLensFlaresSceneNode - need some help
Hi! Im writing this lens flares code and get stuck on a strange behaviour i cannot solve. If you test this node alone, or with some types of nodes in scene, all works well, but if you add a node like AnimatedMeshSceneNode or WaterSceneNode, the lens flares starts to looking strange. This is rendered in wrong position when its go behind one of this node. Ill sending here a modified version of SpecialFX demo, with only source code.
http://geocities.yahoo.com.br/paulo_cmv ... neNode.zip
The basic idea is to render little billboards (3units large) in front of camera (10 units in front). ZBuffer is all disabled, and node doesnt take care of being occluded by some object ( collision is to much particular to each application ). Use setVisible to do it.
Please take a look and say wath you think. Sorry my english
http://geocities.yahoo.com.br/paulo_cmv ... neNode.zip
The basic idea is to render little billboards (3units large) in front of camera (10 units in front). ZBuffer is all disabled, and node doesnt take care of being occluded by some object ( collision is to much particular to each application ). Use setVisible to do it.
Please take a look and say wath you think. Sorry my english
A good solution however i might do it this way
1- draw a line between light source and camera
2- devide line in 4 and get the postion of these points
3- add billboards there
4-The collision being related to different objects can be solved by a meta trianlge selector
if collision true then hide the nodes
btw sorry about my bad explaination may be i can write some code if u want
bye
1- draw a line between light source and camera
2- devide line in 4 and get the postion of these points
3- add billboards there
4-The collision being related to different objects can be solved by a meta trianlge selector
if collision true then hide the nodes
btw sorry about my bad explaination may be i can write some code if u want
bye
>>1- draw a line between light source and camera
>>2- devide line in 4 and get the postion of these points
>>3- add billboards there
I have tryed this, but dont look real, coz billboards will reside in 3d space, instead of 2d space ( the camera lens ); this way, billboards will scale when moving. Also lens flares must cross the screen center, the way you say (between light source and camera) will go only from line the screen center. If you continue you will pass behind the camera... I have tested calculating a midpoint btw light and camera, and using this point as reference, but it dont look right too.
>>4-The collision being related to different objects can be solved by a >>meta trianlge selector
>>if collision true then hide the nodes
Ok, but lets say you using ode, or newton, or something for collision, i will not create all triangleselectors only for colliding a lens flare. Better leave this for user...
>>btw sorry about my bad explaination may be i can write some code if u >>want
I understood this better than you have understood my english, i thing.
At end, i know my code works well, only have a very strange problem. If you look at example that i send, when running it looks well, but if you uncomment the fairy loading code and run it again, you will notice a strange positioning bug. I really dont know why this occurs... coz of this im asking for help...
>>2- devide line in 4 and get the postion of these points
>>3- add billboards there
I have tryed this, but dont look real, coz billboards will reside in 3d space, instead of 2d space ( the camera lens ); this way, billboards will scale when moving. Also lens flares must cross the screen center, the way you say (between light source and camera) will go only from line the screen center. If you continue you will pass behind the camera... I have tested calculating a midpoint btw light and camera, and using this point as reference, but it dont look right too.
>>4-The collision being related to different objects can be solved by a >>meta trianlge selector
>>if collision true then hide the nodes
Ok, but lets say you using ode, or newton, or something for collision, i will not create all triangleselectors only for colliding a lens flare. Better leave this for user...
>>btw sorry about my bad explaination may be i can write some code if u >>want
I understood this better than you have understood my english, i thing.
At end, i know my code works well, only have a very strange problem. If you look at example that i send, when running it looks well, but if you uncomment the fairy loading code and run it again, you will notice a strange positioning bug. I really dont know why this occurs... coz of this im asking for help...
-
- Posts: 208
- Joined: Sun Apr 02, 2006 9:20 pm
Hello ProSoft,
I know this is an old thread but this is still a very nice and simple lens flare effect. Unfortunately there is no license notice in your code but I would like to include this into my IrrlichtWrapper project.
How are you licensing this? Is it under the same type of license as Irrlicht itself?
Thanks,
I know this is an old thread but this is still a very nice and simple lens flare effect. Unfortunately there is no license notice in your code but I would like to include this into my IrrlichtWrapper project.
How are you licensing this? Is it under the same type of license as Irrlicht itself?
Thanks,
demo
Perhaps someone could be kind enough to make this render.
http://www.teslaenergy.ca/CLensFlaresSceneNode.tar.gz
http://www.teslaenergy.ca/CLensFlaresSceneNode.tar.gz