Planetside Software Forums

General => Terragen Discussion => Topic started by: TheBadger on October 04, 2011, 01:27:01 AM

Title: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 04, 2011, 01:27:01 AM
Hello,

I was looking through old image posts when I came by this image and thread by Moodflow : http://forums.planetside.co.uk/index.php?topic=2537.0

If you take a look at the image you will see an incredible level of realism in the ground covering. Moodflow explains that he used "...2D foliage mapped to actual 3D geometry.  'I plugged the image map shader into a default shader, which gave control over diffusion, translucency, luminosity, and reflectivity' (all of which really add realism if done correctly)."

1) My first question is does anyone remember a thread link or tutorial someplace that will teach me how to use and understand image mapping?

2) Can anyone explain in depth What Moodflow has done in the thread I link to above?

I am pretty sure I have seen image mapping in lots of images around here, but nothing like what Moodflow has done that I know of. I would very much like to understand what and how he has done what he did in his image.

Please keep in mind when you answer this thread that I do not have any prior experience in this subject. My hope is that its another thing that just seems complex, but is in reality a simple matter, TG2 is pretty good about that ;)

Thank you.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: rcallicotte on October 05, 2011, 09:34:12 AM
Moodflow was very creative, so his processes are better explained if he could do the explanation.  But, I'll look around here today to see if I can find something to help.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 06, 2011, 05:05:53 AM
Thank you for your interest and any help calico! Yes I would like it if Moodflow could stop by, but I hope that I will find all my answers even if he is busy  :)

So this is where I am at in understanding image mapping... Basically I have only an abstract understanding so far. An image map is a file such as a jpeg or tiff that is imported into a 3D program like TG2. The image contains visual information that can be used (somehow?) to direct and or control the appearance of other data. In the case of Terragen2 image maps are used to texture surfaces, and as masks (what else?).

Additionally image maps can be used in the manner Moodflow has used them (see above) to actually provide 3d information.

So building on my original 2 questions (still need answers)... What types of image maps can be used in terragen, what file formats are best suited for image maps, what is the method for importing, after importing then what, is what moodflow did considered advanced, what is considered a simple use of image maps, how do you use an image map as a mask, and what is the process for using an image map (and what kind of images) in the way that moodflow did?

I know its a lot of questions for one thread. But I think its better to be able to find as much information as possible, on any given subject, in one place.

Thank you again for any help :)

Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: Dune on October 06, 2011, 06:07:34 AM
The best way to get to grips with this is to test it. Use tiff, jpg (color or gray) for your image map shader, try the different projections and sizes you can set, and attach the image map shader to the color input of child input of a test surface layer. Or to the blending input, or the displacement input. Just trying it all out is really the best.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: rcallicotte on October 06, 2011, 08:55:28 AM
Some similar subjects to give you a start to experiment -

http://forums.planetside.co.uk/index.php?topic=11101.0
http://forums.planetside.co.uk/index.php?topic=10640.0

RArcher has some very good ground cover around somewhere and it costs a little $$ to get the file(s).  His work would definitely help your research.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 06, 2011, 06:03:25 PM
@ Dune,
Hi, thanks and yes you are right, experimenting often leads to the best understanding, however it is never the fastest. I will be happy to experiment on my own ones I know some basics and some parameters.

For example, How do I get an image map into TG, is an image map just a clip file? Import Clip file, select .jpeg and bam? Or what?
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 06, 2011, 06:39:42 PM
Quote from: calico on October 06, 2011, 08:55:28 AM
Some similar subjects to give you a start to experiment -

http://forums.planetside.co.uk/index.php?topic=11101.0
http://forums.planetside.co.uk/index.php?topic=10640.0

RArcher has some very good ground cover around somewhere and it costs a little $$ to get the file(s).  His work would definitely help your research.

Thank you very much calico! These links look like they have lots of useful information. And each link has multiple other links that seem to lead to more information of the same subject! I will look through all of it, do some tests, and revise my questions.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: Dune on October 07, 2011, 02:47:34 AM
If you rightclick in the node field and choose 'image map shader' it will automatically have a popup asking for the file. So you enter a file. If it's square, enter 2 identical values in the size field, otherwise keep its ratio. If you want it 100x100m tell it so. But keep in mind that the larger area you want to cover, the larger (more detailed) the image file needs to be. If you want it to be projected at a location away from 0/0/0, set it, otherwise leave it 0/0/0. Set projection to Y for a start and attach the shader to a child of a surface shader. See what happens, work from there.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 07, 2011, 06:28:19 AM
Thanks Dune!

Just a note for this thread: Following Dunes instructions on a mac, right click and then select "create shader" then "Displacement shader" then "Image map shader".

I used an image from this thread for my first attempt http://forums.planetside.co.uk/index.php?PHPSESSID=fdcc073f924ae32981fa0b1f088ebecd&topic=10640.0

At least now Im in the game! Thanks again Calico and Dune, and everyone who contributed to those other threads.

Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 07, 2011, 07:46:22 PM
Galactic Vandal

Ok in this one I did every thing the same as the last. But rather than the image map rising up, it cut into the ground. What did I do wrong?
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: bla bla 2 on October 08, 2011, 04:47:26 AM
How create of mask by image map shader with several image map shader ?

For altitude and differant texture ?

Thank you.

---

Comment on créer plusieurs masque avec plusieurs images maps shader ?
Avec l'altitude et differant texture ?

Merci.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: Dune on October 09, 2011, 02:44:37 AM
QuoteWhat did I do wrong?
Negative displacement perhaps? Try a larger positive displacement or merge with your terrain settings (raise highest) and then raise your image mask until it comes up.

QuoteHow create of mask by image map shader with several image map shader ?
Just blend these image masks by different distribution shaders.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 10, 2011, 01:42:25 AM
I spoke with Moodflow in a pm the other day. He said he is busy with work right now, but would stop by when he gets a chance. Hope soon, really want to understand how he did what he did.

Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 13, 2011, 03:14:25 PM
Hello,

Please consider the image above with the water.
In that image the space in meters between land forms is massive, the land forms them selves are also massive. If I wanted the distance between each land form to be only, say 5-10 feet across, and the land forms themselves to be only 5-8 feet high, how do I go about this?

I tried playing playing with "size" and "displacement amplitude" in the image map shader but was not getting what I expected.

Thank you
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: Dune on October 14, 2011, 03:01:27 AM
How do you mean, you didn't get what you expected? It should work with a much smaller image map size (0.01 or so perhaps) and much smaller displacement (x0.01).
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 14, 2011, 07:44:28 PM
Hello Dune, and thank you for your continued patience and support.

I will try to clarify the things I am seeing.

1) The jpeg I used, and have reposted below, is the image map from the image above. When I open it in photoshop I see that its size is: 513x513pixels, 71228.746x71228.746 inches, resolution 1. When I try to make a similar file I end up with a 1gig file. Can you explain this? I think I may be making something simple into something complex?

2)
Quote from: Dune on October 14, 2011, 03:01:27 AM
How do you mean, you didn't get what you expected? It should work with a much smaller image map size (0.01 or so perhaps) and much smaller displacement (x0.01).
Ok, I see. I Feel dumb, but I don't care. As long as in the end I make images with TG2 that kick ass it will be worth the pain.

3) Can you tell me if it is (in general) better to have lots of grey values or hard blacks and whites? And why? I read you in another thread telling someone why its better to slightly blur an image map. So for the blur reason, I'm thinking grey values are better?

Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: Dune on October 15, 2011, 02:50:11 AM
Jpeg's often have compression artifacts, so better use non-destructive compressed image types, or just plain tiff, or whatever TG2 eats. It was mentioned somewhere lately, tga, bmp, I believe. Then the size of the file is not related to the size in TG2. You can blow a 10x10pixels file to 10x10 square miles. It all depends on the accuracy you need, the bigger the file, the bigger the accuracy. You might not need that if you add some internal displacements anyway.
I'd say, make a gray scale file of 1000x1000px and try to get your angled squares (or whatever you want) in there in strong black/white. That means a flat low area and a flat top area, once you displace this image map. Save as a basic texture, then blur a copy slightly and try that in TG2. If the now grayish sides are too steep, blur the copy a little more, etc. Hope this helps.
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: Kadri on October 15, 2011, 04:59:16 AM
Quote from: TheBadger on October 14, 2011, 07:44:28 PM
...
1) The jpeg I used, and have reposted below, is the image map from the image above. When I open it in photoshop I see that its size is: 513x513pixels, 71228.746x71228.746 inches, resolution 1. When I try to make a similar file I end up with a 1gig file. Can you explain this? I think I may be making something simple into something complex?
...

You might have forget something from here :

http://forums.planetside.co.uk/index.php?topic=10040.0

;)

The most basic approach would be to forget to use cm , inch etc and only use "pixels" for your images .
You can use cm etc. but it gets complicated and is not useful most of the time in the digital world.
Mostly you will not need other then pixel dimensions in standard 3D programs .
Where it gets harder is when you go to printing and so.
But is is easier then you think. The link above is very helpful .
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on October 28, 2011, 07:38:56 PM
Sorry for the long delay, I have been practicing The things covered in this thread.
Happily I can tell you that because of the information in this and other threads I now have a good understanding of the basics in image mapping.

Thank you!
Calico Dune Kadri and Schmeerlap for what everyone can see above. And thank you to Moodflow for talking with me about my OP questions.

Because I have more questions now of (Im very happy to say) a more advanced nature regarding image mapping, and now texture mapping. And because the OP question has been answered, I will start a new thread.

Thanks again guys :D
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: pixelpusher636 on September 23, 2012, 12:18:56 PM
TheBadger it's good you have the image mapping figured out but did you ever get to the bottom of how Moodflow did what he did?
Title: Re: "2D foliage mapped to actual 3D geometry"
Post by: TheBadger on September 23, 2012, 09:29:23 PM
Hi Pixel

Yes I had thought that I posted the solution but after checking I found that I only posted a test image of the result. Here: http://www.planetside.co.uk/forums/index.php?topic=13385.msg132061#msg132061

Here is the basics to do it:

For Terrain:

Select a suitable image, Ideally a photograph made on a bright overcast day. Make sure there are very few if any shadows in the photo. Something like this: http://www.henniker.org.uk/images/1920wallpaper/PoloField_MistyGrass1920.jpg

On a terrain of *similar* or flat (i think) features to the terrain in the source image, project the image through an image map shader. Project with the camera projection option, with the render camera as the reference.

Move your camera to a height and angle that will allow you to match the photos horizon with the horizon in TG2. It does not have to be perfect, but the closer the better.

For rocks, project the source image vertically.

The TG2 scene will take color info from the photos, this helps a lot to make the images work.

Do some tests with the above info.

After that you can use displacements and proximity masks to make things really tight.

Thanks to Moodflow for the above info.

Let me know if I can be of more help Pix.