Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
September 10, 2010, 09:40:24 am
Home
Help
Search
Calendar
Login
Register
Quest3D
>
Open
>
Open Board
> Topic:
Tech Demo: HDR Self Shadow Radiosity Normal Map (Relief Map)
Pages:
1
[
2
]
3
4
Go Down
Print
Author
Topic: Tech Demo: HDR Self Shadow Radiosity Normal Map (Relief Map) (Read 5292 times)
Renzo Sánchez
www.ArtiGames.com
November 13, 2007, 06:51:46 pm
Hi Ali,
Thank you for sharing the source code. If you have enough time, you should write an article or a tutorial. Good work.
I have a couple of questions:
I was skeptical about using lightmaps, because of the video memory consumption, so I tryed to get a good GI using DirectX lights, but I didn't like the result. So, now I am using lightmaps in my projects. Now, I am studing your technique, but I see that you are using 3 lightmaps, I think this is too much if we are talking about a big enviroment. What do you think about it? What is the difference between using one traditional lightmap and using this 3 directional lightmaps? I mean, I can't notice any sustancial difference in quality.
How do you generate the normal map with shadows? I guess you explained how to render the 3 directional lightmaps, but what about the normal map. Thanks.
ali rahimi shahmirzadi
www.ali-rahimi.net
November 13, 2007, 07:30:36 pm
Radiosity Normal Map (RNM) is one of the most popular technic that have been used in Half life2, unreal engine 3 etc.
3 lightmaps are in low res therefore they dont eat memory compare to the final result. Generally for a high quqlity lighting you can use RNM or PRT. PRT will kill the fps. You should read more about RNM to find more about its benefit.
About the different between using one traditional lightmap and using this 3 directional lightmaps i dont understand what you mean. Different is obvious. Press 3 and 8 to see the different.
Renzo Sánchez
www.ArtiGames.com
November 13, 2007, 08:28:29 pm
Quote
About the different between using one traditional lightmap and using this 3 directional lightmaps i dont understand what you mean. Different is obvious. Press 3 and 8 to see the different.
But with those configuration you will see only the difference between using the normal map texture and not using it. I mean the difference between using your 3 lightmaps you have in the project (RNM_0, RNM_1, RNM_2) and using one lightmap.
How did you create the normal map "full shadow"?
ali rahimi shahmirzadi
www.ali-rahimi.net
November 13, 2007, 09:01:20 pm
RNM is a combination of those 3 lightmap mult with normal map. Infact if you combine those 3 lightmap you will end up with a single lightmap. When you press 3 its just like you have 1 light map. here you can try it your self with a single lightmap.
1 lightmap = mult 3 directional lightmap
About the normal map calculation i will post a full article about it soon. Its tricky.
Illumination-spec-mask-alpha.rar
(478.75 KB - downloaded 234 times.)
Renzo Sánchez
www.ArtiGames.com
November 13, 2007, 10:19:37 pm
ok, Ali. Thank you. I will wait for your article.
Test.JPG
(67.9 KB, 990x355 - viewed 150 times.)
«
Last Edit: November 13, 2007, 10:31:49 pm by Renzo Sánchez
»
Viktor Kuropyatnik
VRM Team
November 14, 2007, 01:55:53 pm
Renzo
directional lightmaps can have much lower resolutions than regular lightmaps because - in the pixel shader you actually sample three lightmaps, this lightmaps are different and their combination virtually gives you a better resolution of lightmap. It's like a multi sampling.
Another thing is too improve batching and maybe even performance you can put all three lightmaps into one texture and even add a HDR mask into it to utilize all space.
The main difference between directional lightmaps and regular lightmaps is that DLM gives you ability to use precalculated lighting with normal maps. So, you can have as much statical light as your baking package can handle, and lighting can be very complex. With regular lightmaps it's not possible you need to calculate normal mapped lighting separately for needed point lights or directional lights.
PS: It's something strange with this test image as i cannot understand logic of selfshadowing. It looks more like ambient occlusion as it have shadows in a places where they dont need to be according to the lighting of the other parts of the surface.
«
Last Edit: November 14, 2007, 02:18:42 pm by Viktor Kuropyatnik
»
Renzo Sánchez
www.ArtiGames.com
November 14, 2007, 03:32:04 pm
Thank you Viktor for the information. Now I feel more curiosity about directional lightmaps. I've already read some of the information about it, but I didn't understand very well. Anyway I will keep on it.
Quote
Another thing is too improve batching and maybe even performance you can put all three lightmaps into one texture and even add a HDR mask into it to utilize all space.
How can you put 3 lightmaps in one texture?
ali rahimi shahmirzadi
www.ali-rahimi.net
November 14, 2007, 05:52:29 pm
@ Renzo. The image that you are showing is totally wrong demonstration. They are both have the ssrnm. With single lightmap you will have only a single flat diffuse without any bump or shadow at all.
@ VIctor, We can control the amount of the shadow softness, distance, brightness in photoshop.
ssrnm is a bit tricky cause it use only 3 lightmap. In some position (mostly outdor env) when the sun is on top you might get some occ shadow. But if you want 100% correct lighting you need Directional OCc. Directional Occ have 4 Base vector therefore you have more control over the accuracy. In crysis they use such things for a better lighting direction.
It is a Directional Occ Map for this demo.
attachment #1
Its a small article about creating special normal map for SSRNM.
Firt of all Install maya 2008 and turtle 4.0 or you can rebuild the pipeline in any other app. Its depend on your knowledge.
attachment #2
1. Open maya file its allready set for render. Hit the render. You will have this normal map at the end.
attachment #3
2.In render settings/ render change render type from Texture Bake to surface transfer and hit render. You will end up with a directional occlusion map like this
attachment #4
3. Open photoshop. Place baked Directional Occ on top of the baked RNM texture and change the layer type to Multiply. Infact directional occlusion map is a selfshadow and normal map is RNM. Now you can adjust the opacity of the dir occ layer to control the self shadow intensity. Also you can adjust the level of the dir occ layer to make the shadow soft, hard or change its distance. As you can see you have a full control over it. thats all.
attachment #5
dirocc.jpg
(75.06 KB, 512x512 - viewed 144 times.)
shader-pipeline.jpg
(60.42 KB, 798x626 - viewed 181 times.)
rnm.jpg
(72.2 KB, 512x512 - viewed 106 times.)
directional-occ.jpg
(81.43 KB, 512x512 - viewed 111 times.)
final.jpg
(84.03 KB, 512x512 - viewed 126 times.)
ssrnm-maya.rar
(370.11 KB - downloaded 170 times.)
«
Last Edit: November 14, 2007, 05:55:22 pm by ali rahimi shahmirzadi
»
Viktor Kuropyatnik
VRM Team
November 14, 2007, 06:11:49 pm
Renzo
You can make atlas - you dont need to tile them so you just virtually devide one texture into four peaces and put each lightmap into one of the quarts. Than in pixel shader when you sample texture you just bias a texture coordinates - you remap them to needed quart. This is actually what Valve is doing, you can see part of that code in ppt presentation. I'll make example of that later.
Ali
Thanks for the article!
«
Last Edit: November 14, 2007, 06:13:29 pm by Viktor Kuropyatnik
»
Rhys Black
Lameware
November 14, 2007, 07:28:36 pm
Yeah, Viktor, please do. I like your examples.
I'm going to see if I can funnel this stuff to one of our modelers and see if we can get this going on something of our own.
~Rhys
ali rahimi shahmirzadi
www.ali-rahimi.net
November 14, 2007, 08:16:36 pm
@Viktor. If i understand you sed for example if there is 3 256x256 DR light map then you atlas these 3 DR lightmap to the single 512x512 + one extra 256x256. Am i correct?
Renzo Sánchez
www.ArtiGames.com
November 14, 2007, 11:36:32 pm
Quote
@Viktor. If i understand you sed for example if there is 3 256x256 DR light map then you atlas these 3 DR lightmap to the single 512x512 + one extra 256x256. Am i correct?
You can put four 256x256 textures in one 512x512 texture. 512x512 = 262 144, 4x256x256 = 262 144
I also would like to see an example. The problem with using atlas is the size of the texture. In my project, there is a big difference when I use lightmaps of 128x128 and 256x256. So, I am using both resolutions and in the configuration the user can choose between low res and high res. So, if I use an atlas, I have to use bigger textures, 512x512 for example. I think that it is ok maybe for small enviroments, but what about big enviroments, how do you optimize the video memory?
Atlas is more suitable for avoiding batching.
http://forum.quest3d.com/index.php?topic=58361.0
I gave all the information to my modellers, they already know how to generate the lightmaps, but I don't know how can I make it to work in a big enviroment, with a lot of objects and a lot of textures.
I've already have a lot of normal maps in my scene. So far, I have 120 mb in the video memory. The maximum charge of video memory in the game need for speed most wanted is 161 mb.
You can also notice in the picture that they are using just 2127 draw primitive calls for that enormous city, they know about performance.
need_for_speed.jpg
(227.27 KB, 1280x1024 - viewed 205 times.)
«
Last Edit: November 14, 2007, 11:43:10 pm by Renzo Sánchez
»
Viktor Kuropyatnik
VRM Team
November 15, 2007, 01:57:59 pm
Renzo, you dont need bigget textures, you can use texture of the same size because directional lightmaps can have a smaller size as you sample three texture to get approximation, you need to think of them like about sinlge texture.
Rhys Black
Lameware
November 15, 2007, 04:01:12 pm
Yeah, since you're adding them together, you have greater precision. So for the same precision, smaller size will do the same work.
IDK for sure, but it should give you 3 times the precision if you use the same size maps. So if you use maps of 1/3 the size then you should get the same precision. In practice, if you use maps half the size, then you should end up with slightly more precision than before.
This is just spitballing, though. I'm not experienced with texture math, but that's how it seems.
~Rhys
ali rahimi shahmirzadi
www.ali-rahimi.net
November 16, 2007, 02:23:28 pm
There is another optimized solution to use SSRNM with only a single lightmap. You can bake Directional lightmap (Without shadow, only illum)to vertex color RGB.
R: directional lightmap 1
G: directional lightmap 2
B: directional lightmap 3
And then use a single lightmap for other purpose like Occ, Shadow, HDR, etc. This way you will have a correct lighting for the Normal map but with a single lightmap.
Pages:
1
[
2
]
3
4
Go Up
Print
Quest3D
>
Open
>
Open Board
> Topic:
Tech Demo: HDR Self Shadow Radiosity Normal Map (Relief Map)
Jump to:
Please select a destination:
-----------------------------
Quest3D
-----------------------------
=> Job opportunities
=> Events
=> Announcements
=> F.A.Q.
-----------------------------
Open
-----------------------------
=> Open Board
-----------------------------
Quest3D Topics
-----------------------------
=> General Questions
=> Demos
=> Tips & Tricks
=> New features
=> Plug-ins
-----------------------------
Advanced
-----------------------------
=> OO (Object Oriented Programming)
=> Physics
=> HLSL and Shaders
Loading...