Itoo Software Forum

Forest Pack => Forest Pro (*) => Topic started by: Rawalanche on December 31, 2016, 01:33:54 AM

Title: Can not figure out how to drive scale with map without ruining distribution
Post by: Rawalanche on December 31, 2016, 01:33:54 AM
Hi,

as usually, after having to deal with forestpack after a while, i am again about to pull all my hair out.

Basically, I've setup distribution of grass on a surface, and I have set it up exactly as I want it. I want to retain exactly 100% the look I have developed, but I now need to drive scale of the grass on some areas of the surface with map.

Right now, I have random scale of my grass patch instaces, ranging from 80% to 150%.

I have a texture map mapped on the surface, where black is grass and white is roads. I have plugged inverted version of the map into scale slot. See the picture below:
(http://forum.itoosoft.com/index.php?action=dlattach;topic=4203.0;attach=7481)


Basically, whenever there is black color on the screenshot (white on inverted version that is plugged into the slot) I want my instances to remain 100% same, therefore ranging randomly from 80% to 150%of size. Where there is white on my screenshot, I want grass to scale down to 0%. So grayscale gradient would scale instances from 80-150% to 0% based on value in the gradient.

Unfortunately, I can not figure any way to perform this essential task.

When I plug the inverted map, scale gets immediately messed up. If I enable probability map option, scale reverts to normal (same as without map), but black color on the scale texture does not scale instances down to 0 but only to Min value.  >:(

Title: Re: Can not figure out how to drive scale with map without ruining distribution
Post by: iToo on December 31, 2016, 10:26:47 AM
Hi, it's not possible to achieve that in a single step, because you need two transformations: random scale from 80% to 150% and map scale from 0% to 100%.
Probability map can drive random scale according the map, but only using the specified range (80-150), not 0-100.

If you want to keep the current distribution and transform, it can be done in this way:

- Convert distribution to Custom Edit mode (Tree Editor->Custom Edit).
- Be sure all grass patches are visible (set Display limits to 0).
- Enable sub-edit mode and select all items.
- Apply Tree Editor->Store Random (Properties box). That will store random transformations within items and turn off Transform checkboxes.
- Restore Display limits as desired.
- Now set Transform scale 1%-100% and enable map. "Probablilty" must be off. Please note minimum scale is 1%, since 0% would give problems because the coplanar faces.

If you want to remove 1% scaled items, it would be done with a custom Effect. Something as: fpItem.visible = if(fpItem.scale.z < 1, 0, 1);

Also there are other ways to get similar results:

a) Use the image as Distribution Map, to exclude scattering along the roads (black area).
b) Create a custom Scale map combining two textures (i.e. using "Composite" ): a "Noise" for the random part, and the image as mask.

I hope that helps.
Title: Re: Can not figure out how to drive scale with map without ruining distribution
Post by: Rawalanche on January 02, 2017, 05:43:19 PM
Hi, it's not possible to achieve that in a single step, because you need two transformations: random scale from 80% to 150% and map scale from 0% to 100%.
Probability map can drive random scale according the map, but only using the specified range (80-150), not 0-100.

If you want to keep the current distribution and transform, it can be done in this way:

- Convert distribution to Custom Edit mode (Tree Editor->Custom Edit).
- Be sure all grass patches are visible (set Display limits to 0).
- Enable sub-edit mode and select all items.
- Apply Tree Editor->Store Random (Properties box). That will store random transformations within items and turn off Transform checkboxes.
- Restore Display limits as desired.
- Now set Transform scale 1%-100% and enable map. "Probablilty" must be off. Please note minimum scale is 1%, since 0% would give problems because the coplanar faces.

If you want to remove 1% scaled items, it would be done with a custom Effect. Something as: fpItem.visible = if(fpItem.scale.z < 1, 0, 1);

Also there are other ways to get similar results:

a) Use the image as Distribution Map, to exclude scattering along the roads (black area).
b) Create a custom Scale map combining two textures (i.e. using "Composite" ): a "Noise" for the random part, and the image as mask.

I hope that helps.

Hi,

thanks for the quick response even over the holidays. Unfortunately none of the solutions worked. I am scattering over huge area, so making all grass patches visible results to 3ds Max freeze followed by unresponsiveness and crash.

Distribution map is also not an option, because i need grass to gradually scale down on the edges of roads, to create natural falloff. Distribution map creates very ugly chopped out effect.

Custom scale map does not preserve look I have already set up.


That being said, I've found solution myself. I have set scale override of the geometry objects I am scattering to 1%, and used inverted probability map with scale values from 800 to 15000. This way, I can use probability map to drive between tiny 1% scaled instances and 80-150% randomness without using clumsy Tree Editor workflow.


Non the less, you guys should really re-think your feature design. It's another feature that works in surprising (not in a good way) fashion. On the one hand, you accommodate for extremely niche workflow of driving scale randomness probability with texture maps, on the other hand you do not accommodate for extremely frequent requirement of simply driving scale of already set up forest distribution with texture map. That I think is a lot more common requirement then driving distribution randomness with it.

So, when I plug texture map into scale map slot, and probability is disabled, I would expect the white color on the map to mean original instance size between min and max value, and black color on the map meaning 0% scale. Right now, using map results to white color meaning max value, and black color meaning min value, and using a texture map completely disables scale randomization.
Title: Re: Can not figure out how to drive scale with map without ruining distribution
Post by: Michal KarmazĂ­n on January 03, 2017, 12:31:01 PM
Hi,

Well, the Transform - Scale Map is designed to be used for driving Min & Max values. If you want to leave these random in a specific range and limit the distribution by a map, you should "mask" these areas within the Distribution Map - for example by using the Composite Map as shown on the screen-shot.

To easily archive the Scale Falloff on these areas, a "helper Forest object" as excluding area can be used (being driven by an inverted Distribution Map) and adjusted as needed by the Distribution Map - Falloff - Scale - Exclude value.

Attaching a sample scene using this work-flow. Hope you'll find it useful.

Best regards,
Title: Re: Can not figure out how to drive scale with map without ruining distribution
Post by: Rawalanche on July 21, 2017, 05:01:18 PM
Hi,

so for about last 5 scenes I had to use forestpack on a project, 5 out of 5 times I ran into a situation, where I needed to drive scale of of instances in a forest that has already randomized instance scale, and I needed to keep the scale randomization of the instances without touching it. 5 out of 5 times has forestpack failed me and I had to resort to painful workarounds.

Therefore I am bumping this thread again. I am really perplexed that such a common scenario is not covered by a 200EUR plugin when free CoronaScatter can do it out of the box.
Title: Re: Can not figure out how to drive scale with map without ruining distribution
Post by: Paul Roberts on July 21, 2017, 06:47:23 PM
HI,

I think this may be possible by extending Forest Pack's features using a relatively simple Forest Effect.

All you need to do is go to the Effects rollout, open the editor and enter this little expression

fpItem.scale = fpItem.scale*fpItem.tintColor.x;

(http://i.imgur.com/g9QgjuL.jpg)

You can now add your scale map to the map slot in the Material rollout. Just change the mode to As Texture and it should work for you.

(http://i.imgur.com/MSLwXB7.jpg)


You can save that effect or add it to the library so that you don't need to remember it every time. If this solves your issue we'll add it to the built in library so other users can benefit. This would effectively add the feature to Forest Pack.

In future versions we have plans to add the ability to add map parameters so you wouldn't need to repurpose the tint map in the Materials rollout.

A sample file is attached. I hope that helps.

All the best,

Paul
Title: Re: Can not figure out how to drive scale with map without ruining distribution
Post by: Rawalanche on July 22, 2017, 10:40:07 AM
HI,

I think this may be possible by extending Forest Pack's features using a relatively simple Forest Effect.

All you need to do is go to the Effects rollout, open the editor and enter this little expression

fpItem.scale = fpItem.scale*fpItem.tintColor.x;

(http://i.imgur.com/g9QgjuL.jpg)

You can now add your scale map to the map slot in the Material rollout. Just change the mode to As Texture and it should work for you.

(http://i.imgur.com/MSLwXB7.jpg)


You can save that effect or add it to the library so that you don't need to remember it every time. If this solves your issue we'll add it to the built in library so other users can benefit. This would effectively add the feature to Forest Pack.

In future versions we have plans to add the ability to add map parameters so you wouldn't need to repurpose the tint map in the Materials rollout.

A sample file is attached. I hope that helps.

All the best,

Paul

Thanks for the effort, however this just replaces one frustrating workaround with another one. On some of my forest objects, I am already using Material roll-out settings to randomize colors of my instances, so in order to perform this workaround, I need to override forest maps on all the instances I am scattering in material editor, to be local to material, instead of using material settings in Forest objects, and then, if I need to tweak the color randomization, and have let's say 5 instances with 5 different materials, I have to go through each of the 5 materials, and repeat the tweak.

I still do not understand the need to hide feature which accommodates for so extremely frequent requirement behind some advanced custom effects. I mean, the ForestPack UI is already such a mess that one more option will not make much difference, but this one, would at least be useful for something, unlike legacy stuff like fake shadows or 2D cards. If implemented in a smart way, it would not even add more UI elements, just replace one checkbox with one dropdown...

(https://forum.itoosoft.com/index.php?action=dlattach;topic=4203.0;attach=9025)
Title: Re: Can not figure out how to drive scale with map without ruining distribution
Post by: Rawalanche on July 22, 2017, 10:48:51 AM
Actually, with some smart cleanup, it could be even more compact than current layout:

(https://forum.itoosoft.com/index.php?action=dlattach;topic=4203.0;attach=9027)