PDA

View Full Version : How to set density of instances according to weight map



Sebasvideo
04-04-2014, 09:18 AM
In the instancer, the way a weight map works, whether it's a texture or a vertex map, is that it will make the instances that would be in the black or 0% weight areas invisible. Meaning, if you assign 10000 instances to an object, if you made a vertex map or texture that puts all the weight in one small area, it won't show you 10000 instances in that area you designed, but it will show you, of those 10000, the ones that would go in that area if there was no weight map. This is easy to see by disabling the weight map and enabling it.

But, since the higher the number of instances the more it takes to calculate, it would be nice if I could set 500 instances of what I need in small patches of the ground, rather than set 10000 or more and not show the rest according to the weight map. Is that possible?

CaptainMarlowe
04-04-2014, 10:12 AM
Use DP_instancer instead of native distribution system. It can work that way. You set your weight map and then set the number of instances you want according to its weight map, and only the instances you want.

Sebasvideo
04-04-2014, 10:49 AM
Thanks, I'm trying that now, but it seems to be far slower than the native instancer at a much higher number of instances. Meaning that it's faster to set the native instancer to hide a large number of instances than to use DP Instancer to cram a much lower number in the areas I need them. I'll have to run more tests to be sure, but so far it seems that way.

Sebasvideo
04-04-2014, 10:55 AM
Also, while the bounding boxes show on OpenGL mode, they don't show in VPR mode, and switching to VPR takes ages even though it's the only instancer active.

prometheus
04-04-2014, 02:51 PM
you must have a lot of instances? I donīt recall having any issues with instances in VPR, but as mention, im guessing it is becuase of extremly high amount for grass etc.

if you want exact amount of instances in some areas, you can use particles you know:) then use particle mode when instancing the objects.
1000 particles per frame and set the limit to match that, or make more if you want.

you can distribute particles on a large surface with birth rate and use textures or procedurals like weave to make some cornfields or something...or even make an army which is distributed by a weave procedural texture so they are
organized in groups.

you can also avoid trying to place them all in one surface and instead use separate poly planes, and use particles on that...if it is a displaced terrain it would require you to maybe freeze the terrain, then cut the parts where you want instances,and merge with the non freezed terrain back again...for use with instances only.

you can also just make a dense grid in modeler kill polys, then select the points you want and delete the rest, and then use the points as instancer placement object.

Lot of ways, question is just what will suit you the best.

Sebasvideo
04-04-2014, 04:01 PM
Thanks Michael, but if I use particles, won't they be moving around? That would not seem too real for trees :)

It's not a big deal, using the native instancer things are slow, but I just disable what I don't need to work with at a particular time. As long as I can enable all of it and it doesn't eat my 32 GB of RAM and starts going into the pagefile, it's not a big deal, since I will be using a render farm for this, it takes about 20 minutes per frame in my 3930k and that's my fastest computer, so it would take weeks to render the whole thing.

prometheus
04-04-2014, 05:17 PM
Thanks Michael, but if I use particles, won't they be moving around? That would not seem too real for trees :)

It's not a big deal, using the native instancer things are slow, but I just disable what I don't need to work with at a particular time. As long as I can enable all of it and it doesn't eat my 32 GB of RAM and starts going into the pagefile, it's not a big deal, since I will be using a render farm for this, it takes about 20 minutes per frame in my 3930k and that's my fastest computer, so it would take weeks to render the whole thing.

nope, not unless you give them some motion, and just as long they are set to birth rate frame and not seconds, and you must have equal amount of birth particles as you have amount set in the particle limit.

you also need to make sure they live as long as the animation is, otherwise they will pop out an die.

What you also can do, that is to convert the particles to partigons, I think that should work..the particle2 partigon command does that, it is a little hidden and I would recomend opening edit menu, and search for Particle2partigon...and you will find it..drag that command to a menu where you want it.

This way you will get a static point cloud based on a particle emitter, can be nice to know if you want to simulate a particle emitter til it reaches a nice cluster formation and save it as a static cloud.

- - - Updated - - -

By the way, I can not reply fast now...something is wrong with my forum settings, I do not receive any notifications anymore when someone replies.

Michael

prometheus
04-04-2014, 05:36 PM
A further note, if you use particles on surfaces, and use a birth rate procedural texture, and have for instance 1000 particles in birth rate, and a particle limit of 1000, you will get a pop in of the particles that isnīt correct...to fix that, change the particle generator key effect to key, I think default setting is none...and it should all be generated at once without any increasement of new particles.

itīs easier to have set a high birth rate, then simply control amount of particles with the particle limit, since it wonīt matter if you change the birth rate to 2000 or 5000, it will only be 5 particles if you set that limit, or change it til 200 or whatever and thatīs what you will get.

for using procedural textures, I would suggest use them in alpha blending mode, and use world coordinates, you can try bricks, weaves etc to distribute the particles.

prometheus
04-04-2014, 05:50 PM
updated...correcting.
I was misleading you, setting the key effect to key, will cause issues later, instead, fix your particles to a start frame before 0 like -1

One thing I miss though, not sure if it is possible, that would be to get the particles fixed in pattern and at the same time use procedurals for particle birth.
you can arrange the particle density distribution with procedural patterns, but thereīs always a slight randomness between the particles, in the placement.

Michael

dwburman
04-06-2014, 01:43 PM
One thing I've done working with a large outdoor scene with grass and trees. Was to select parts of the terrains and give them different surface names. With the instances generating by surface, I could get a much denser distribution in the areas I needed. For instance, you'd create one general surface for the terrain, and then select the polys where you want trees and give them a different surface name. The surface settings can be the same for all the surfaces of the opbject (copy/paste settings when making changes), but giving the polys different names worked well for controlling instance placement.