Planetside Software Forums

Support => Terragen Support => Topic started by: pokoy on August 27, 2019, 05:31:47 AM

Title: Populating Bitmaps?
Post by: pokoy on August 27, 2019, 05:31:47 AM
So I finally came to the conclusion that it's way more effective for my needs to use textures rather than building terrain shaders with crazy numbers of noise nodes and masks.
Since I mostly need spherical environments for aviation imagery, the camera's high up in the air overlooking huge areas.

My idea was that I could populate bitmaps on a terrain with random placement, rotation, size - basically what the Populator does with geometry - ideally with a border blend to make tiling less obvious.

Is there any way to achieve this with TG's current toolset? If not, I'm pretty sure it would be a very useful and effective addition.
Title: Re: Populating Bitmaps?
Post by: Dune on August 27, 2019, 05:50:14 AM
Not possible, afaik. You'd have to project the bitmaps somehow (Y), and that can only be achieved by importing texture image maps and merging them together by PF or altitudes, that sort of thing. But repetition is imminent if you don't have (large) enough image maps.
I'm sure procedural would be far better, and even with a few nodes nice terrain effects can be achieved. No need for hundreds of nodes.
Title: Re: Populating Bitmaps?
Post by: pokoy on August 27, 2019, 09:55:15 AM
Yeah, thought so... I hoped someone has figured out a way to do this in the past maybe.

Doing it with nodes may be possible for noise-like structures but in this special case - a mix of rural and village landscape types - I'm way better off by using satellite images, creating masks for noise nodes and 'scattering' them, that's way more efficient... and it would render much faster I guess. In this case, the kind of noise voronoi provides isn't really cutting it.

Thinking further it might be useful for so many different situations, think of it more like using scanned objects versus having to model and creating a texture first. I think it would open up many useful possibilities and make a nice shortcut to believable textures without the hassle of noise nodes. Combined with tri-planar mapping it would be quite a nice thing to have in TG in general.
Title: Re: Populating Bitmaps?
Post by: Dune on August 27, 2019, 01:46:57 PM
I agree. Maybe, one day.......
Title: Re: Populating Bitmaps?
Post by: Oshyan on August 27, 2019, 01:55:40 PM
This is definitely an idea we've discussed at Planetside before and I agree it's an interesting one. Technically I think you can already implement a basic version of this by simply using populated cards or an imported rectangle with your image mapped to it. You'd need multiple populations to handle multiple images, and overlaps wouldn't be smoothed in any way, so it's a limited method, but it may be worth trying, especially if you add alpha maps to the edges of your loaded images/cards which would allow them to blend a bit.

Not sure how hard it is to implement something more sophisticated and specific to scattering images, but it's in the feature request tracker at any rate. :)

Ultimately the kind of improvements to populating that we have planned would I think also help with techniques like this...

- Oshyan
Title: Re: Populating Bitmaps?
Post by: cyphyr on August 27, 2019, 05:05:15 PM
Using cards works well on smaller images, leaves and general debris for example but for larger images that have to blend in with the terrain, it's basically unfeasible.
Glad it's on the tracker, look forward to seeing it :)
Title: Re: Populating Bitmaps?
Post by: Tangled-Universe on August 28, 2019, 05:22:19 AM
How about populating cards with the texture applied, so you have rotation/size variation and use force displacement mode on the object driven by the terrain displacement? Critical in this idea is that the "sit on" shader is not the terrain, but the undisplaced planet/plane.
Title: Re: Populating Bitmaps?
Post by: Dune on August 28, 2019, 06:49:50 AM
I think it's hardly possible without strange artifacts. If you populate cards with an image projected on it (world space), you get a lot of overlapping cards (edges) and thus shadows from one card onto another. Unless I misunderstand the way you guys think.
Title: Re: Populating Bitmaps?
Post by: Tangled-Universe on August 28, 2019, 07:54:50 AM
The way I see it is that the cards may overlap on a flat surface, due to size/scale variation, but taken as a whole they are essentially 1 plane.
Displacing the population as a whole will deform the cards as if it is 1 plane so should generate similar results as if displacing the plane to get a terrain.
Or from another angle: can we displace 1 big card object in force displacement node using the terrain displacement and have it look similar as the terrain?
I don't see why not.
Question is then: will the plane object subdivide sufficiently when using force displacement mode or do we need a higher poly card object as texture holder?
Title: Re: Populating Bitmaps?
Post by: Dune on August 28, 2019, 08:30:09 AM
You could be right. Interesting challenge anyway.
Title: Re: Populating Bitmaps?
Post by: N-drju on September 02, 2019, 05:06:46 AM
Quote from: Tangled-Universe on August 28, 2019, 07:54:50 AMQuestion is then: will the plane object subdivide sufficiently when using force displacement mode or do we need a higher poly card object as texture holder?

I don't think the native card object has any limitations regarding the subdivision / point numbers. You could apply any displacement to any card with any scale conceivable and it will just heed to this fractal / displacement / etc.

I remember I used a card as a water surface with the actual water shader on it. With all the ripples and waves it has to offer. It was indistinguishable from a default, circular lake object. Would have been much different if card had any set subdiv amount.
Title: Re: Populating Bitmaps?
Post by: Tangled-Universe on September 02, 2019, 06:53:46 AM
Well, that's good to know then... Never tested that myself. So theoretically it should work...but will it?
Title: Re: Populating Bitmaps?
Post by: N-drju on September 02, 2019, 08:05:37 AM
Quote from: Tangled-Universe on September 02, 2019, 06:53:46 AMWell, that's good to know then... Never tested that myself. So theoretically it should work...but will it?

Guess it's pokoy's turn to discover. ;)

Why not? If one knows how to bend a card parallel to a planet's curvature plus apply a displacement following the surface normal, then they are good to go.

The only limitation is the knowledge. I can't see any technical (or, to be more precise, "polygonal") obstacle whatsoever.

EDIT: Whoa, wait, wait, wait... do you mean "plane" or do you mean "card"...? Because I notice you use these terms interchangeably. These are different things. Even if slightly.
Title: Re: Populating Bitmaps?
Post by: pokoy on September 02, 2019, 08:30:59 AM
My original request was neither of both, not planes, not cards - instead, simply scatter textures, without having to deal with the surface displacement or other objects. It's often available in other packages and renderers: load a few texture files, randomize positions/scale/rotation, set border blend values, maybe randomize hue and saturation.

I thought about placing cards but you'd probably have no border blending and I guess it takes some additional rendertime to displace the cards according to the underlying surface. All of this sound rather cumbersome... and even if possible it's above my head.

I'm recreating the landscape as good as I can with noise nodes and a few surface layers... it works but I'd rather used satellite textures for more realism.

Anyways, I hope it's going to be added, there seems to be interest :D
Title: Re: Populating Bitmaps?
Post by: N-drju on September 02, 2019, 08:50:09 AM
Quote from: pokoy on September 02, 2019, 08:30:59 AMI'd rather used satellite textures for more realism.
If this is what you need, then it's doable. There are guys out here who use satellite imagery inputs (DEMs, MOLAs, whatever it is called). I never need it, but I think someone could aid you.
Title: Re: Populating Bitmaps?
Post by: Tangled-Universe on September 02, 2019, 10:36:01 AM
Quote from: pokoy on September 02, 2019, 08:30:59 AMMy original request was neither of both, not planes, not cards - instead, simply scatter textures, without having to deal with the surface displacement or other objects. It's often available in other packages and renderers: load a few texture files, randomize positions/scale/rotation, set border blend values, maybe randomize hue and saturation.

I thought about placing cards but you'd probably have no border blending and I guess it takes some additional rendertime to displace the cards according to the underlying surface. All of this sound rather cumbersome... and even if possible it's above my head.

I'm recreating the landscape as good as I can with noise nodes and a few surface layers... it works but I'd rather used satellite textures for more realism.

Anyways, I hope it's going to be added, there seems to be interest :D

I know, but since it's not available you get these thought experiments :P

If you mean multiple textures fading in/out of each other then that's easy as pie...multiple image map shaders mapped to the UV coordinates, mix them using PF guided merge shaders and then feed that output to the texture input of the object's default shader.
Title: Re: Populating Bitmaps?
Post by: Oshyan on September 02, 2019, 02:11:35 PM
My understanding is he wants to essentially have a bunch of e.g. textures of individual fields/farm plots, houses perhaps, etc., and then scatter and mix those textures in a way that creates plausible results. It would be a cool thing to be able to do, but I think getting actually good results from it would require more than simplistic texture blending. That generally shows up as quite clear fading between textures that looks unrealistic in otherwise sharp photo-based textures. 

I think the populated Card idea is a really interesting one though. I don't have time to try it at the moment but I hope someone does!

And yes, the difference between Card (populateable) and Plane (displaceable object but not populateable) is perhaps subtle but definitely important.

- Oshyan
Title: Re: Populating Bitmaps?
Post by: pokoy on September 02, 2019, 02:53:50 PM
Let's say if I would scatter masks - not color textures - and make sure these have some randomness to them enough I guess the idea would certainly deliver good results, even if blending the texture border would produce blurriness. The mask would be used for nodes which would certainly 'breakup' the look.

The problem in my case is simply that noises do not produce the patterns i'm after. If the tool was present I would use it, since it's not people smarter than me will probably able to mimic this to some extent BUT there's a significant difference between a math-based solution that requires deep knowledge of present tools, math nodes AND the pitfalls and a ready-to-go node that does all of this plus some more on the other hand. And saves you and the client hours that you then can put into other areas of the job or get the job done quicker. If TG wants to be accessible there's no way around some user friendly and versatile low-entry tools.

This is in no way meant to be snarky but were such tools available the forum wouldn't probably need multi-paged threads about blocky rock displacements with 10 different ways how to get the look (or not). It would be a simple PS job to produce some masks and there you go. I don't mean to diminish the amazing stuff people produce and discuss - I really do love it - I just question the fact that in TG you often need to sort of reinvent the wheel to get somewhere. 

Sorry for the off-topic semi-rant but I spent too many hours today not getting what I was after ;) Thanks for all the suggestions!
Title: Re: Populating Bitmaps?
Post by: Oshyan on September 02, 2019, 02:56:06 PM
Oh I completely understand and agree. Greater directability and perhaps some more  "out of the box" solutions are definitely needed.

- Oshyan
Title: Re: Populating Bitmaps?
Post by: N-drju on September 02, 2019, 04:21:25 PM
Such nodes would sure be handy, but at the same time prohibitively render-heavy methinks. Kind of a trade-off.
Title: Re: Populating Bitmaps?
Post by: Dune on September 03, 2019, 01:50:13 AM
A function input in a transform shader (I have once asked for it, many years ago) would already help a lot, so you'd be able to randomly rotate (rotation by whiteness of a PF/distribution shader, whatever) a texture from a tileable image map on Y. Some masking and more of those, and Bob's your uncle  ;)