Home Help Search Login Register


Pages: 1 2 
Send Topic Print
Radiosity Normal Mapping (Read 7837 times)
Ali Rahimi
Junior Member
**


http://www.ali-rahim
i.net

Posts: 86
Radiosity Normal Mapping
10/01/07 at 01:28:27
 
As you know Radiosity Normal Mapping is a method that have been used in Half-Life®2 / Valve Source™Shading
 
http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf
 
In a doc they say : In Radiosity Normal Mapping, we transform our basis into tangent space and compute light values for each vector.
Therefore we will have 3 lightmap in tangent space.
 
turtle render engine for maya support Radiosity Normal Mapping
 
http://www.illuminatelabs.com/turtle/technical-specifications
 
I do a test. now with turtle for maya i can bake and see radiosity normal map directly in maya plus other stuff as you can see.
Fantastic. just like Half Life 2.
 
All source files:
http://www.ali-rahimi.net/other/radiosity-normal-map.01.rar
 
albedo
directional-occlusion
hdr-lightmap
hdr-radiosity-normal-map
normal-height-map
mesh.x
 
So my question is is it possible to rebuild the Radiosity Normal Mapping shader pipeline in shaderfx.
The source code is available in this pdf http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf
 
Code:
lightmapColor[0] * dot( bumpBasis[0], normal )+
lightmapColor[1] * dot( bumpBasis[1], normal )+
lightmapColor[2] * dot( bumpBasis[2], normal ) 


 
Or even if we could rebuild the entire shader with shaderfx it will be fantastic. cause its a shader pipeline that have been used in may next gen game engines like HL2 and Unreal3.  
 

 

 
Thanks.  
 
Back to top
 
 

http://www.ali-rahimi.net
Email WWW Ali Rahimi ali_rahimi_3d_cg   IP Logged
bencloward
Forum Moderator
*****


ShaderFX Co-Author

Posts: 519
Re: Radiosity Normal Mapping
Reply #1 - 10/01/07 at 07:38:57
 
Radiosity Normal Mapping is indeed a very cool technique because it makes it possible to combine pre-baked light maps together with normal mapping - something that wouldn't otherwise be possible.  If you understand how the math works, it's possible to do all of it with ShaderFX's current tool set.  The main trick is calculating the bumpBasis direction for each of the three light map sample directions.  This can be done in the shader, but I think it's something that only needs to be done once, so it would be much more efficient for the game engine to support it and pass it in to the vertex shader.  This isn't something that we could do in ShaderFX, so you'd probably just need to calculate it instead.
 
The other tricky part is actually creating the light map.  The way I understand it, the light map is split up into three different sections.  Each of the sections of the map represents what the lighting would look like if the surface normal was pointing in one of the three bumpBasis directions.  I could be wrong here.  It would be really helpful if you could send me one of the radiosity normal maps that Turtle generates so I can see how it's working.
 
I can see a pipeline problem if it's only possible to create the radiosity normal map in Maya using Turtle, and our software is designed to run inside of 3ds Max.  That means that you'd have to do some pretty crazy shuffling around back and forth to get the geometry, radiosity normal map, textures, and shader all together in one program.  It sure would be nice if there were a version of Turtle for 3ds Max.
 
Although it is possible already to support this using ShaderFX's current set of tools, I think we could make it a lot easier and cut down on the number of nodes required by making a group node, or maybe a new material node that has this functionality built into it.  I'll add it to the feature request list and we'll look into the best way of making this work.
 
Thanks for the suggestion, Ali!
 
-Ben
Back to top
 
 
WWW bencloward bencloward   IP Logged
Ali Rahimi
Junior Member
**


http://www.ali-rahim
i.net

Posts: 86
Re: Radiosity Normal Mapping
Reply #2 - 10/01/07 at 10:58:43
 
Quote:
It would be really helpful if you could send me one of the radiosity normal maps that Turtle generates so I can see how it's working.

But ben i post the link it top with all the source files including radiosity normal maps that Turtle generates.
so again.  
http://www.ali-rahimi.net/other/radiosity-normal-map.01.rar
 
About the shader itself. yes its avery cool and important shader. I hope you rebuild it in shaderfx or help me how to make it. or even if you could rebuild the entire shader including spec env cube map that would be amazing cause as you know having a lots of light for especular is very expensive. therefore in hl2 and unreal engine 3 they bake spec in to cube map.  
I also find this cool paper too.  
http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_EfficientSelfShadowe dRadiosityNormalMapping.pdf
About generating Light map for Radiosity Normal Mapping for 3dsmax dont worry there should be some tools somewhere to do this. but for the start i think the shader itself is much more important.
Back to top
 
 

http://www.ali-rahimi.net
Email WWW Ali Rahimi ali_rahimi_3d_cg   IP Logged
jrapczak
YaBB Newbies
*


Microsoft Excel
Artist

Posts: 27
Re: Radiosity Normal Mapping
Reply #3 - 10/15/07 at 02:56:22
 
Actually, in my experience the shader is trivial. Finding the tools to create the lightmaps is the huge problem, because you need to store the incoming RGB light along each of the basis vectors as a separate lightmap. If you are planning on using this in a project I highly recommend you find an efficient way to generate the required maps before you worry too much about the shaders. Sounds like Turtle might be a good solution for Maya. The tricky bugger is 3DSMAX - I haven't seen anything to do this in MAX yet. Sure would be nice if someone wrote a MAX shader that works with Render-to-Texture to do this! Wink
 
Let us know if you find something that works.
Back to top
 
 
Email   IP Logged
Ali Rahimi
Junior Member
**


http://www.ali-rahim
i.net

Posts: 86
Re: Radiosity Normal Mapping
Reply #4 - 10/15/07 at 06:30:03
 
A guy here build the stand alone renderer for Radiosity Normal Mapping. If you read the posts you can find it and ask him about his renderer.
http://www.gamedev.net/community/forums/topic.asp?topic_id=464586
For maya we have turtle. Its perfect as you can see.  Wink
Back to top
 
 

http://www.ali-rahimi.net
Email WWW Ali Rahimi ali_rahimi_3d_cg   IP Logged
wdcstudios
YaBB Newbies
*




Posts: 18
Re: Radiosity Normal Mapping
Reply #5 - 10/16/07 at 16:41:30
 
I saw a program called xnormal I wonder if something could be written to make that create radiosity normal maps.
Back to top
 
 
Email   IP Logged
Viik
YaBB Newbies
*




Posts: 9
Re: Radiosity Normal Mapping
Reply #6 - 11/09/07 at 06:27:03
 
Actually it's pretty simple to render such lightmaps in Max.
Before baking lightmaps you need to put special normal maps on your object. This normal maps will be used instead on normals of the object, it will point in the same directions as a basis vectors of the DIrectional light maps.  
Another solution is too make a script that will change normals in tanget space.
 
than you just bake your lightmaps, that's all.
 
And this is a basis vectors from HL2 article:
R = ( sqrt(2/3), 0, 1/sqrt(3) )
G = ( -1/sqrt(6), 1/sqrt(2), 1/sqrt(3) )
B = ( -1/sqrt(6), -1/sqrt(2), 1/sqrt(3) )
Back to top
 
 
Email   IP Logged
Viik
YaBB Newbies
*




Posts: 9
Re: Radiosity Normal Mapping
Reply #7 - 11/09/07 at 11:25:38
 
If somebody is interested, in attachment you can find 3 normal maps - it's a 16-bit tiffs and example 3D Max scene that is ready for baking Directional Lightmaps.
Just assign one of three normal maps, bake lightmap and than repeat process with another normal map. Materials with normal maps is already in scene.  
Normal map file names corresponds to names of basis vectors from previous post.
Back to top
 
Email   IP Logged
Kees
Administrator
*****




Posts: 608
Re: Radiosity Normal Mapping
Reply #8 - 11/09/07 at 11:45:22
 
That's awesome Viik.
Thanks!
 
-Kees
Back to top
 
 
WWW   IP Logged
Mexicola
YaBB Newbies
*




Posts: 1
Re: Radiosity Normal Mapping
Reply #9 - 08/23/08 at 06:49:24
 
Quote from bencloward on 10/01/07 at 07:38:57:
Although it is possible already to support this using ShaderFX's current set of tools, I think we could make it a lot easier and cut down on the number of nodes required by making a group node, or maybe a new material node that has this functionality built into it.  I'll add it to the feature request list and we'll look into the best way of making this work.

 
Can you show us a good layout for Shaderfx about radiosity normal map?
You know.....the tree is this
 
thanks
Back to top
 

source2_s.jpg
  IP Logged
Ali Rahimi
Junior Member
**


http://www.ali-rahim
i.net

Posts: 86
Re: Radiosity Normal Mapping
Reply #10 - 08/31/08 at 14:17:49
 
this is a pipeline  

 
also i build an example  
 
http://www.ali-rahimi.net/other/self-shadow-radiosity-normal-map.exe
 

 
Back to top
 
 

http://www.ali-rahimi.net
Email WWW Ali Rahimi ali_rahimi_3d_cg   IP Logged
Nando Aviels
YaBB Newbies
*




Posts: 4
Re: Radiosity Normal Mapping
Reply #11 - 09/01/08 at 12:22:56
 
Asowe Ali. could be fantastic if  you can share an example with your source code.  
 
Thanks  Cool
Back to top
 
 
Email   IP Logged
nbac
YaBB Newbies
*




Posts: 12
Re: Radiosity Normal Mapping
Reply #12 - 03/12/10 at 03:24:57
 
Quote from Ali Rahimi on 08/31/08 at 14:17:49:

 
hmpf! i tried everything - iam not able to rebuild a working shader fx tree ... where in your example are the lightmaps what are the settings for the rnm maps ... and so on ... a sfx file for the whole effect would be awesome.
 
ben when is the hlsl 3 dvd release? to setup such shader could be part of it Smiley
Back to top
 
 
Email   IP Logged
Ali Rahimi
Junior Member
**


http://www.ali-rahim
i.net

Posts: 86
Re: Radiosity Normal Mapping
Reply #13 - 03/12/10 at 03:39:01
 
New shaderfx have RNM. you dont need mine anymore.
Back to top
 
 

http://www.ali-rahimi.net
Email WWW Ali Rahimi ali_rahimi_3d_cg   IP Logged
nbac
YaBB Newbies
*




Posts: 12
Re: Radiosity Normal Mapping
Reply #14 - 03/12/10 at 04:14:57
 
okay i see! sorry... anyway the rest of the effect is also very interesting selfshadowing and so on...
you said you did the whole shader in sfx?
Back to top
 
 
Email   IP Logged
Pages: 1 2 
Send Topic Print