Dot3 Normal Bump Mapping + Per Pixel Lighting
+8
_-MADMAN-_
autology
uprise78
finthamoussu
Francescu
goldfrapp0x0309
fleg
sio2interactive
12 posters
Dot3 Normal Bump Mapping + Per Pixel Lighting
Take a look at the link above:
http://www.vimeo.com/4309315
Basically Im switching between 4 mode of lighting the first one being the default OpenGL one and 3 other mode controlled by combiners... You can also invert the side of the bumps and control the lighting conditions via combiners callbacks, I think its pretty flexible
A tutorial will be added in 1.3.6 to show you how it work basically its 2 SIO2 call so it should be easy to integrate within your project(s).
Now I know what you guys are asking yourself: "That's all great but what about performance?"
I test 80 objects like this:
object/Cube ( 72:372:81% ) ( 213:372:43% )
So basically its a total of: 10k or triangles and it run at 30 ~ 42 fps on my iPod Touch 2nd Gen, all the lighting is done in the main thread so there's plenty enough space for optimization there such as calculating the lighting in another thread etc...
http://www.vimeo.com/4309315
Basically Im switching between 4 mode of lighting the first one being the default OpenGL one and 3 other mode controlled by combiners... You can also invert the side of the bumps and control the lighting conditions via combiners callbacks, I think its pretty flexible
A tutorial will be added in 1.3.6 to show you how it work basically its 2 SIO2 call so it should be easy to integrate within your project(s).
- Code:
if( !init_tbn )
{ sio2ObjectSetTBN( _SIO2object, inverted ); }
sio2ObjectDot3Lighting( _SIO2object,
sio2->_SIO2camera,
_SIO2lamp );
Now I know what you guys are asking yourself: "That's all great but what about performance?"
I test 80 objects like this:
object/Cube ( 72:372:81% ) ( 213:372:43% )
So basically its a total of: 10k or triangles and it run at 30 ~ 42 fps on my iPod Touch 2nd Gen, all the lighting is done in the main thread so there's plenty enough space for optimization there such as calculating the lighting in another thread etc...
Last edited by sio2interactive on Fri Apr 24, 2009 5:37 am; edited 4 times in total
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
Dude. DUDE. AWESOME.
fleg- Posts : 4
Join date : 2009-04-20
Was beddin'
Dragged myself out of bed n.... WOW!!! Hope it performs quick and fast too...
goldfrapp0x0309- Posts : 43
Join date : 2009-02-28
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
The ligthing calculation need to be executed in per frame, but it can easily be calculated in a separate thread... I'll create a tutorial showing how to do it...
Im also doing a quick hack and avoid make sure that the vector are exactly perpendicular so like that its like a lot less calculation and with work fine with convex shapes so, but it is not mathematically fully accurate... If I had access to shaders it would be but...
Im also doing a quick hack and avoid make sure that the vector are exactly perpendicular so like that its like a lot less calculation and with work fine with convex shapes so, but it is not mathematically fully accurate... If I had access to shaders it would be but...
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
Very very nice!
Francescu- Posts : 136
Join date : 2009-03-18
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
Can't see the video : "Sorry, you do not have permission to watch this private video."
finthamoussu- Posts : 10
Join date : 2009-03-30
Age : 41
Location : Montevideo, Uruguay
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
I get the "private video" message too. How can we view the video?
uprise78- Posts : 228
Join date : 2008-10-31
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
try again - video is working for me.
As for the demo.... I can't wait to play. This engine is going to be leaps and bounds ahead of where it was when I took a break from coding.
As for the demo.... I can't wait to play. This engine is going to be leaps and bounds ahead of where it was when I took a break from coding.
autology- Posts : 22
Join date : 2008-12-29
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
Just brilliant! One of the best iPhone cg effect I have ever seen - players will get crazy!
What with materials? Any plans for integration that feature with blender? Texture binding and set - same way as with lm in actual sio2 sdk. I'm talking about export ofcourse
Regards!
What with materials? Any plans for integration that feature with blender? Texture binding and set - same way as with lm in actual sio2 sdk. I'm talking about export ofcourse
Regards!
_-MADMAN-_- Posts : 52
Join date : 2009-04-23
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
works now and it looks great!
uprise78- Posts : 228
Join date : 2008-10-31
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
Man this looks awesome! cant wait to see the tutorial
Neo- Posts : 1
Join date : 2009-04-02
sio2ObjectDot3Lighting source?
Is it possible to get the source for sio2ObjectDot3Lighting and sio2ObjectSetTBN before release of 1.3.6? Like maybe . . . right now?
sgreenwalt- Posts : 18
Join date : 2009-04-24
Location : Layton, Utah
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
Actually, you can get it up and running by simply doing this...
1. Simply use tutorial08 and arrange the texture of the ground so the first texture channel is the normal map and the second is the diffuse, make sure that you set the 2 UV channel properly (or simply duplicate them).
2. In the code simply add the following block:
Here's the normal map for the stone wall:
http://sio2.dreamhosters.com/stone_wall_normal_map.jpg
1. Simply use tutorial08 and arrange the texture of the ground so the first texture channel is the normal map and the second is the diffuse, make sure that you set the 2 UV channel properly (or simply duplicate them).
2. In the code simply add the following block:
- Code:
glActiveTexture( GL_TEXTURE0 );
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_DOT3_RGB );
glTexEnvf(GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE);
glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
glTexEnvf(GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PRIMARY_COLOR );
glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR);
glActiveTexture( GL_TEXTURE1 );
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_MODULATE );
glTexEnvf( GL_TEXTURE_ENV, GL_SRC0_RGB, GL_TEXTURE );
glTexEnvf( GL_TEXTURE_ENV, GL_SRC1_RGB, GL_PREVIOUS );
glTexEnvf( GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR );
glTexEnvf( GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR );
Here's the normal map for the stone wall:
http://sio2.dreamhosters.com/stone_wall_normal_map.jpg
Re: Dot3 Normal Bump Mapping + Per Pixel Lighting
Very nice demo indeed! The video works fine but I think the normal map looks inverted?
I'm curious though, would animated models (ones with md2 morph targets or the hybrid armature system, things with moving vertices) need to have bitangent data assigned to its vertices so that dot3 would work on deformed models and if so, would this be possible at a decent framerate? Also I'm not too sure if this was asked before but was sphere mapping at all possible with the iphone or was it a limitation that you needed the cpu to do the mapping? I'm thinking it would be really cool to mix that with the dot3 and make animated water effects
I'm curious though, would animated models (ones with md2 morph targets or the hybrid armature system, things with moving vertices) need to have bitangent data assigned to its vertices so that dot3 would work on deformed models and if so, would this be possible at a decent framerate? Also I'm not too sure if this was asked before but was sphere mapping at all possible with the iphone or was it a limitation that you needed the cpu to do the mapping? I'm thinking it would be really cool to mix that with the dot3 and make animated water effects
MistaED- Posts : 4
Join date : 2008-11-08
Similar topics
» SIO2 Engine v1.4 is out!
» Shadow & Shading Issues
» UV mapping
» How to replace the object mapping?
» Material colors and lighting
» Shadow & Shading Issues
» UV mapping
» How to replace the object mapping?
» Material colors and lighting
Permissions in this forum:
You cannot reply to topics in this forum