Itoo Software Forum

Author Topic: Self Illumination  (Read 9493 times)

Ramboll

  • Jr. Member
  • **
  • Posts: 67
Self Illumination
« on: November 28, 2008, 10:34:56 AM »
Hi

I`m having a problem with FP 3.03.
I use MR sun & Sky i 3ds MAX. As you see on the attached pictures, the forest reacts different depending on were the sun is. Why is this? I don`t remember having this problem in the previous versions of Forest Pack. Is there no way out of this without having each tree texture set to self illumination in the material editor? It looks ok when i set the self illumination in the material to 50%.

Hope you can help with an easier solution

Best Regards

Bjørnar
3D Designer

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Self Illumination
« Reply #1 on: November 28, 2008, 05:09:48 PM »
Hi,

Since Forest uses billboards that are rotating to face the camera, the illumination of each tree is very dependant of the sun's position. A tree with the light at its back, will look black.

To avoid this problem, is needed to use some type of global illumination. In Mental Ray, there are two choices: Self-illumination (in the material) or Final Gathering. As is not easy to modify the Self-illum parameter of each material to adjust the illumination on a scene, we have introduced a new parameter in Forest (Material rollout): Self-illum factor, that works as a multiplier of the Self-illum value for all materials used by a Forest object.

If Final Gathering is enabled, Self-illum is not needed because Mental Ray applies a global illumination to all objects in the scene (radiosity). In Forest 3.04b we have included a new parameter to adjust the radiosity effect over Forest objects: Irradiance Color (in Material rollout as well).

So, we suggest this configuration for MR scenes:

a) With Final Gathering enabled:

- Forest Self-illum factor: 0%
- Material Self-illum: not used (as it's multiplied by 0)
- Irradiance Color: adjust it to get the desired global illumination over the trees

b) Final Gathering disabled:

- Forest Self-illum factor: Use it to adjust the global illumination. A starting value of 50% is ok.
- Material Self-illum: 50%. Create all your new materials with this value, you won't need to modify it... use SI factor instead. All materials of the Forest libraries have 50% by default as well.
- Irradiance Color: not used

About previous versions of Forest Pack... well, we have rewritten the Mental Ray shaders completely. Now you must to adjust some parameters, but the plugin is much more flexible and you will get best results. Forest 2 had big problems under certain illumination conditions.


Carlos Quintero
iToo Software

Ramboll

  • Jr. Member
  • **
  • Posts: 67
Re: Self Illumination
« Reply #2 on: December 01, 2008, 11:49:57 AM »
Hi again!

I noticed that the Forest Self-illum factor in the Material Rollout didn`t have any effect on the lighting of the forest object.
In the same scene as before, I have now the "Forest Self-illum" and the "Material Self-Illum" set to 0%. The Irradiance Color is set to complete white. The dark area of the forst objects is now much brighter, but the part that has more sun is still brighter. (See attachment, the first picture is the forest with the old parameters, the second with the new parameters).
No matter what I do, I can`t get the same brightnes all over the forest without having the Material Self-Illum set to about 50%. I don`t remeber having this problem in the previous versions.

Best Regards

Bjørnar

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Self Illumination
« Reply #3 on: December 01, 2008, 05:09:13 PM »

Quote
I noticed that the Forest Self-illum factor in the Material Rollout didn`t have any effect on the lighting of the forest object.

It only has effect if the Material Self-illum is not zero (Self Illum = SI Material * SI Factor)

I have repeated my tests with MR and you are right. If some conditions may be necessary to apply Self-illum, as instance if the sun is perpendicular to the camera. So, this would be a more suitable configuration:

a) Final Gathering enabled:

- Forest Self-illum factor: 20%-100%
- Material Self-illum: 50%
- Irradiance Color: any color in the full range

... using SI Factor + Irradiance to adjust the global illumination

b) Final Gathering disabled:

- Forest Self-illum factor: 20%-100%
- Material Self-illum: 50%
- Irradiance Color: not used

However, this is only a suggested starting configuration because each scene is different. If you want, post here your scene (only the trees) and we will adjust the parameters.

By the way, is there any problem to use Self-illum on your materials ?

Carlos Quintero
iToo Software

Ramboll

  • Jr. Member
  • **
  • Posts: 67
Re: Self Illumination
« Reply #4 on: December 02, 2008, 09:29:39 AM »
well it`s not a big problem to use Material self-illum, it`s just that in this project I use 7 different kinds of forest objects. I also use the forest-library with a pre-defined forest I have created, this contains 8 different tree-textures. So when I`m going to set the material self-illum to 50%, I have to do this 56(7x8) times because the different forest objects can`t have the same texture(instance).(Why is this by the way)?

The forest library I have, has the material self-illum set to 0% for each texture.
So I was hoping there was a way around this. The obvious thing I have to do, is to create a new library with the material self-illum allready set to 50%.
But why has this changed from the previous versions?
What defined the self-illum in the previous versions? Planes-Material?

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Self Illumination
« Reply #5 on: December 02, 2008, 07:02:26 PM »

Quote
I have to do this 56(7x8) times because the different forest objects can`t have the same texture(instance).(Why is this by the way)?

Really Forest can reuse the same materials if you assign them on the material parameter (Geometry rollout), but... i just noticed that the Library Browser is creating duplicated materials. We didn't know this issue, i will look if we can fix it for the next patch.

To help you to assign the self-illum values, i just wrote two max scripts:

- Set self-illum for all materials in the current material library -

lib = currentMaterialLibrary
for m in lib do
  (
  base = m.material1
  base.selfIllumAmount = 50
  )


To use it: 1. load material library, 2. run it, 3. save library

- Set self-illum for all materials of the selected Forest object -

m = $.material
for i = 1 to m.numsubs do
   (
   base = m.material1
   base.selfIllumAmount = 50
   )


Use: 1. select Forest object (only one at time), 2. run it

Forest 2 materials also was using self-illum, not defined in Planes Material but in the standard material used as base. You can see it loading the old libraries (SI = 30%). However, SI value was ignored in Mental Ray, since the trees always was full self-illuminated (as 100%). This was a bug of the plugin, fixed now in Forest 3.

Carlos Quintero
iToo Software

Ramboll

  • Jr. Member
  • **
  • Posts: 67
Re: Self Illumination
« Reply #6 on: December 03, 2008, 08:44:00 AM »
Thanks for all the help! These scripts helps me alot!
Our company really enjoys your product! We really appreciate your respons in these forums! this is one of the main reasons we use your product.
Looking forward to the next patch!

Have nice day! (you guys are probably sleeping now, but our day has just started as the clock is 8:30 AM here in Norway ;) )

Best Regards

Bjørnar Moland

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Self Illumination
« Reply #7 on: December 03, 2008, 09:14:14 AM »
I'm glad that the scripts be useful for you.

I would like to be sleeping now, but now in Spain is time to start working as well, hehe.  ;)

Carlos Quintero
iToo Software

Ramboll

  • Jr. Member
  • **
  • Posts: 67
Re: Self Illumination
« Reply #8 on: December 03, 2008, 09:54:03 AM »
Hi again!

I`m having some problems with the script regarding - Set self-illum for all materials in the current material library

you say I have to load the library, what do you mean by this?
I have created a library, and I select the different trees from this library in the geometry rollout. The texture for this forest is then a Multisub object.
When I try to run the script I get this message:

----------------------------------------------------------------------------------------------------------------------------------------------

#materialLibrary()
-- Error occurred in m loop; filename: ; position: 104
--  Frame:
--   m: Norsk_BlandingsSkog_Holskogen:Forest_Material_3
--   base: #Multi/Sub-Object:Norsk_BlandingsSkog_Holskogen(Forest Material 3:Material #28, Forest Material 3:Lauv_mellom, Forest Material 3:Lauv_mellom, Forest Material 3:Lauv_mellom, Forest Material 3:Stor Furu, Forest Material 3:Vår_bjørk, Forest Material 3:Liten Furu, Forest Material 3:Material #117)
-- Unknown property: "selfIllumAmount" in #Multi/Sub-Object:Norsk_BlandingsSkog_Holskogen(Forest Material 3:Material #28, Forest Material 3:Lauv_mellom, Forest Material 3:Lauv_mellom, Forest Material 3:Lauv_mellom, Forest Material 3:Stor Furu, Forest Material 3:Vår_bjørk, Forest Material 3:Liten Furu, Forest Material 3:Material #117)

----------------------------------------------------------------------------------------------------------------------------------------------


iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Self Illumination
« Reply #9 on: December 03, 2008, 11:32:00 AM »
Hi,

You have to load a material library on the material editor (Get Material button->Browse from Mtl Library->File Open). All materials must be of type "Forest Material 3", the script modifies the Self-illum automatically to all of them.
Carlos Quintero
iToo Software