Planetside Software Forums

General => Terragen Discussion => Topic started by: TheBadger on October 30, 2011, 09:37:42 PM

Title: More Texture mapping stuff
Post by: TheBadger on October 30, 2011, 09:37:42 PM
Hello,

In looking through threads for information and discussions about texture mapping and image mapping (these terms sometimes are used interchangeably. Is it correct to do so?) I was un able to find a straight forward topic on applying a texture map to an image mapped terrain.

Can one apply an image map as a texture to a terrain? For example I attached a .tgd with a terrain made from an image map in the shape of a wall. here is a link to a high quality image for texture (should I say detail or texture in this case?) http://www.lovetextures.com/index.php/architectural/part-white-wall/

I tried to 'attach' the image to the terrain wall, in the same way I made the wall. I also tried using a distribution shader thinking I could apply the image to only a vertical surface. No luck.

I am able to get the image to appear and effect my wall but not in the way I want. Also I am trying to avoid using the render camera as the projection method. And so I am wondering if the notion of projection is the problem? When you use an object in a terrain, the object is not a projection, can I, within TG2, truly texture an image with a map (without clicking displacement check box? What about bump ambient specular, how do these play a roll in TG2?

Could use some help getting through this, so thanks in advance for your thoughts.
Title: Re: More Texture mapping stuff
Post by: TheBadger on October 30, 2011, 09:40:18 PM
here is the simple wall for conversations sake ;)
Title: Re: More Texture mapping stuff
Post by: Dune on October 31, 2011, 03:50:30 AM
Try this as a basic setup. Probably things to improve, but put together quick 'n dirty.
Title: Re: More Texture mapping stuff
Post by: yossam on October 31, 2011, 03:53:08 AM
You forget to include your wall with the .tgd. Check out the render............it is very low quality so it may have some artifacts. What you are talking about is possible............it's just a pain to get it close to right.
Title: Re: More Texture mapping stuff
Post by: TheBadger on November 01, 2011, 09:29:25 PM
Thank you Dune.
I was glad to see that my method was really close to the one you shared with me. You use more nodes, but I didn't see too much of a difference. Though I have a lot of displacement to make it hard to tell... Anyway, Same problem with what you showed me as what I was getting on my own, but at least now I am sure of what the problem is.

Its the Size filed in 'projection/location' filed. Can you or any one please tell me what the size is relative to? I mean should the size be as close to what the image for projection is? I cant seem to get it right and so my image map is all stretched out. Looks bad.

Yossam,
If possible, will you post your file for the image you showed. I would like to see if your doing something different.

Also,
If there is a simple answer to what TG2 can do with bump, ambient, specular please share.  :)

Thank you all
Title: Re: More Texture mapping stuff
Post by: Dune on November 02, 2011, 03:32:59 AM
The size is relative to the number of pixels of the image map. Best to see if you project on the Y axis and see what it does on ground. You can also put a camera in front of whatever you want to project an image on and check projection through camera, and assign the camera, of course.
Title: Re: More Texture mapping stuff
Post by: TheBadger on November 06, 2011, 06:13:51 AM
Hello,
Thanks Dune, but Im sorry to say I still need help with this. Please look at the images I am posting below and the 2 images in the following link: http://www.cadcourse.com/winston/BumpMaps.html
The link if for a different program, but bump mapping is bump mapping. Isn't it??

My question now is, why wont the texture 'wrap" the vertical in my terrain?

In the image Im trying to make I have many walls that go back to the horizon, and Im planing on animating the scene. So rather than projecting an image viewable from one spot, I want what you see below globally. I'm half way there! I just cant get the verticals to take the bump map no mater what I try. Sorry to be so slow.

Thank You


Title: Re: More Texture mapping stuff
Post by: Dune on November 07, 2011, 02:33:11 AM
The terrain in TG is not UV-mapped, so to speak, like you would do an object. You have to decide how to project your image/bumpmap onto differently angled parts of the terrain. So you need at least three angles (top, left/right, front/back). It won't be easy, because you have to project on one side but not having the other side interfere with the first, to say the least. I'm afraid I can't help you very much further in this. Perhaps it is even quite impossible...
Title: Re: More Texture mapping stuff
Post by: Kadri on November 08, 2011, 10:09:54 PM


You have two topics about this , TheBadger. I thought this is the better place .

It can be done. But i would do it as an object if you ask me.

It has problems but planed accordingly you could use it anyway.

I did put two TGD files in the  " Projects.7z "  attachment file (below here in this post). One with a merger shader , the other without.
If you or anyone want to make better nodes etc. feel free. There are many ways probably.
For example i used 3 surface shaders ; You could use less (it works too).
Do not read too much in the settings. I made this very quickly only to test if this works.
There could be checked places i didn't wanted to check etc.  :)

The "The_Wall_Tests..."  picture ( look at the next post below) :

1 : I tried to merge the X and Z wall side textures but could not do it properly with this method .
     (The walls are not smooth because i made a very basic mask very fast . So please do not take it into consideration. )

2 : This is much better but you have to plan and make the masks accordingly.
     I only partially made some changes you see here marked .The mask is a little different. For the X and Z side.

3 : Texture only on "Projection type : Side X" .

4 : Texture only on "Projection type : Side Z" .
     Maybe if Planetside (or some of the node-math wizards here ;) ) would put kind of a "Cubic Mapping"(if possible) option most of this could be done more easier.


I tried the LWO exporter . It has his own problems (polygon heavy for better object) but i would use this (with Poseray(free) you can convert it to Obj ).
But everyone has his own work flow and programs of course .

Hope this is any use for you or others.

Cheers  :)


Title: Re: More Texture mapping stuff
Post by: Kadri on November 08, 2011, 10:11:13 PM

Continued from above:
Title: Re: More Texture mapping stuff
Post by: TheBadger on November 09, 2011, 02:23:39 AM
@Kadri!

Did you have this from before or did you make it just to explain your ideas about how to do it? Whichever is the case I thank you for the help. And if you made the files you posted just for this thread than thank you very much! But please don't be offended if I don't post something soon on the subject, I just looked at the files in your .7z and its going to take a while for me to understand what you have done. My user level is not as high as yours or the other members who have been helping me. I will want to understand the nodes them selves and not just how you used them, and that will take a bit for me.

Thanks again

Title: Re: More Texture mapping stuff
Post by: Kadri on November 09, 2011, 07:49:57 AM

No problem , TheBadger ! I made this test files only because you asked :)  What matters is if this helps you or not.

For better understanding look at the slope settings on the surface shaders.
This is maybe the most important part for getting the texture on the side walls and not affecting the ground..
And of course there could be other approaches  by the open nature of TG2.
Title: Re: More Texture mapping stuff
Post by: bobbystahr on November 09, 2011, 10:15:44 AM
Looks like a sweet solution Kadri...well worked out...KUDOS .  ..   ...
Title: Re: More Texture mapping stuff
Post by: Kadri on November 09, 2011, 10:20:24 AM

Thanks  :)
Title: Re: More Texture mapping stuff
Post by: TheBadger on November 14, 2011, 07:26:48 PM
So kadri,

I have looked through the files you posted and found that I was able to understand them. Its really great because as a result I now understand a lot of other things too. Once I was able to figure out what your nodes where doing and how you used them I found that I could apply that knowledge to many other nodes!  8)

For example, By seeing you use the surface layer node the way you did I was able to think of other ways to use it my self. I also began to look for a similar node in the terrain node set. I found the redirect shader and because of your file my project and this conversation was able to use it for the texture bump, the way you used the surface node to build a loop for the detail image maps! lol, Terragen2 is much funner to use when you understand whats going on ;D

But I also have a question. When applying a bump with a redirect shader (x,y,z) I got total coverage. But in the set up you shared, to get the color and detail from the image map, masks are needed. Why does the one not require masks and the other does?

Also, Im not sure yet even how to make a mask, I have not got that far yet, I have been experimenting with the other stuff first. But my project is really shaping up!
Title: Re: More Texture mapping stuff
Post by: Kadri on November 14, 2011, 09:38:47 PM
Quote from: TheBadger on November 14, 2011, 07:26:48 PM
...
But I also have a question. When applying a bump with a redirect shader (x,y,z) I got total coverage. But in the set up you shared, to get the color and detail from the image map, masks are needed. Why does the one not require masks and the other does?

Also, Im not sure yet even how to make a mask, I have not got that far yet, I have been experimenting with the other stuff first. But my project is really shaping up!


My background is 2D and 3D. Terragen2 covers these of course. But then there is the aspect with nodes and math etc.
This is the part where i am not good. I use them so much i can. But it is mostly trial and error.  Mostly the latter  :)

So i use masks because i am more familiar with them.
I think what you make with the redirect shader (i nearly don't used it much) is that you assign it to the say Z it will use the image only in that axis in all the TG2 world.
With masks you are restricting only negatively or positively where the image-texture should be placed.

Terragen 2 does have so much possibilities as i said above that you could make all the same thing with quite another approach.
For example to use the texture for the ground and for the top of the Wall you could have used only the "Surface layer" with "Altitude constraints" setting too.
Because the example i put here is very basic and on a flat terrain you could make this without using the mask approach.

Not sure if this is an answer to you TheBadger :)


Title: Re: More Texture mapping stuff
Post by: TheBadger on November 15, 2011, 12:30:45 AM
QuoteI think what you make with the redirect shader (i nearly don't used it much) is that you assign it to the say Z it will use the image only in that axis in all the TG2 world.
With masks you are restricting only negatively or positively where the image-texture should be placed
This helps me greatly Kadri, thanks.

Can you also tell me if the red nodes are interchangeable between the terrain tab and the shaders tab? That is, all red nodes are part of the same node set despite being separated by category-Terrain/shaders?
Title: Re: More Texture mapping stuff
Post by: Kadri on November 15, 2011, 01:10:38 AM
Quote
...
Can you also tell me if the red nodes are interchangeable between the terrain tab and the shaders tab? That is, all red nodes are part of the same node set despite being separated by category-Terrain/shaders?

This is the part where the other guys should chime in TheBadger probably  :)
I for one do try these kind of things (i don't read the manuals at first).
And you can plug most nodes everywhere.
Kind of a help but not so restrictive as it looks at first maybe if you ask me.
So i do not much bother about this. Not sure if you mean this , TheBadger .

And i hate nodes !
I think that all the programmers in the world made a secret meeting (Matt i heard you were there too ;)), where they made a agreement that using partly made objects like lego parts are easier to program for them , then to make good and detailed interfaces  ;D
Title: Re: More Texture mapping stuff
Post by: TheBadger on November 15, 2011, 02:03:12 AM
@anyone

According to Terragen 2 Node Reference "The Redirect Shader allows you to "redirect" the effect of the input shader along a specific axis."

When using the redirect shader I can direct 3 bump maps for displacement perfectly. However, when trying the same thing for color, it does not work. Color does not seam to pass through the redirect shader. What can I do about this, if anything?

@kadri
Thanks man. as for me I haven't decided if I like nodes or not yet.
Title: Re: More Texture mapping stuff
Post by: TheBadger on December 06, 2011, 04:33:27 AM
Quote from: TheBadger on November 15, 2011, 02:03:12 AM
@anyone

According to Terragen 2 Node Reference "The Redirect Shader allows you to "redirect" the effect of the input shader along a specific axis."

When using the redirect shader I can direct 3 bump maps for displacement perfectly. However, when trying the same thing for color, it does not work. Color does not seam to pass through the redirect shader. What can I do about this, if anything?

Still could use an answer for this.^^

Also, can someone please point me to a how to make and use masks in TG2 thread? I searched but no luck. I think this subject is the last step for me in a comprehensive understanding of image maps in TG2.

Thank you

P.S. Where did Kadri go? Haven't heard from him in the forum for a while.
Title: Re: More Texture mapping stuff
Post by: Tangled-Universe on December 06, 2011, 06:19:47 AM
You basically already gave the answer yourself ;)
The redirect shader process displacement as input, so vector values, but not colour values.
Generally, if you want to displace colour you'll need a warp-shader since this warps texture space.

If you create a warp shader + redirect shader and connect the redirect shader as the "warper" for the warp shader and connect your colour image/function to the "shader" input of the warp shader you can warp the your colour image/function by feeding powerfractals with displacement into the redirect shader.

Cheers,
Martin
Title: Re: More Texture mapping stuff
Post by: Kadri on December 06, 2011, 10:17:02 AM
Quote from: TheBadger on December 06, 2011, 04:33:27 AM
...
P.S. Where did Kadri go? Haven't heard from him in the forum for a while.

TheBadger  i read hastily in the forums and then go to fighting in Skyrim.
Will probably return some times in the future  ;D
Title: Re: More Texture mapping stuff
Post by: bobbystahr on December 06, 2011, 12:10:51 PM
@ TheBadger...so what part of using image maps as a mask don't you get? I regularly use them for masks for a variety of functions including dispersal of objects, to keep grass from poking thru fake stones stuff like that.
Title: Re: More Texture mapping stuff
Post by: TheBadger on December 07, 2011, 06:01:58 PM
Quote from: bobbystahr on December 06, 2011, 12:10:51 PM
@ TheBadger...so what part of using image maps as a mask don't you get? I regularly use them for masks for a variety of functions including dispersal of objects, to keep grass from poking thru fake stones stuff like that.

Hello bobbystahr,
Thanks for helping.
I know what a mask is and how people use them. I guess what I need to know is how are they made in TG, and how are they applied. I can make a mask in photoshop for use in photoshop. But I don't know how in TG. Just haven't done it yet.

Given any hypothetical project you like (as simple as possible) what are the steps? For me, I think I am interested in learning how to use them as a distribution method first.
Title: Re: More Texture mapping stuff
Post by: TheBadger on December 07, 2011, 06:07:24 PM
Quote from: Tangled-Universe on December 06, 2011, 06:19:47 AM
You basically already gave the answer yourself ;)
The redirect shader process displacement as input, so vector values, but not colour values.
Generally, if you want to displace colour you'll need a warp-shader since this warps texture space.

If you create a warp shader + redirect shader and connect the redirect shader as the "warper" for the warp shader and connect your colour image/function to the "shader" input of the warp shader you can warp the your colour image/function by feeding powerfractals with displacement into the redirect shader.

Cheers,
Martin

Thanks again Martin! I will try this.
I think you are officially a Guru now.
Title: Re: More Texture mapping stuff
Post by: bobbystahr on December 07, 2011, 09:54:04 PM
Quote from: TheBadger on December 07, 2011, 06:01:58 PM
Quote from: bobbystahr on December 06, 2011, 12:10:51 PM
Given any hypothetical project you like (as simple as possible) what are the steps? For me, I think I am interested in learning how to use them as a distribution method first.

I'll put a small tute on my method together tomorrow A M...off to a guitar gig atm...
Title: Re: More Texture mapping stuff
Post by: bobbystahr on December 09, 2011, 02:44:16 AM
Quote from: bobbystahr on December 07, 2011, 09:54:04 PM
Quote from: TheBadger on December 07, 2011, 06:01:58 PM
Quote from: bobbystahr on December 06, 2011, 12:10:51 PM
Given any hypothetical project you like (as simple as possible) what are the steps? For me, I think I am interested in learning how to use them as a distribution method first.

I'll put a small tute on my method together tomorrow A M...off to a guitar gig atm...

Okie Dokie...here you go..Just extract to your projects directory, fire up TG2 and open MAPTUTE023.tgd and have a look around.
If anything isn't obvious please ask....have fun. The objects are all free from here in File Sharing btw
Title: Re: More Texture mapping stuff
Post by: TheBadger on December 11, 2011, 11:30:10 AM
Hi bobbystahr,

Thanks for posting the files. Sadly I wont have time to devote until monday night. But I'll get on it and let you know what, if any, questions I have. Thanks again for your help. These little things in TG are very important I think.
Title: Re: More Texture mapping stuff
Post by: TheBadger on December 29, 2011, 03:36:55 AM
Thanks bobbystahr.
Helped me a lot. Have another question in this same vain of masking but I want to use a TG image to illustrate my question. And I need to wait until a render finishes first.

Title: Re: More Texture mapping stuff
Post by: bobbystahr on December 29, 2011, 10:39:11 AM
Quote from: TheBadger on December 29, 2011, 03:36:55 AM
Thanks bobbystahr.
Helped me a lot. Have another question in this same vain of masking but I want to use a TG image to illustrate my question. And I need to wait until a render finishes first.



LOL...happens to me often, heh heh heh, waiting on a render...I'll be here......
Title: Re: More Texture mapping stuff
Post by: TheBadger on January 13, 2012, 03:00:48 AM
Hi,

Ok, I had a file to render to help make my question clear, but somethings not working with it. Anyway, my question is, I have a some what flat-ish terrain, through out the terrain are what look like drumlins. I like every thing about the image, but for one hill. I would like to use an image map to make the hill more or less go away. Can it be done, and how?
Title: Re: More Texture mapping stuff
Post by: Dune on January 13, 2012, 03:15:16 AM
Use a painted shader or simple shape over that hill and add this to a displacement shader's function input. Set it to some minus figure and your hill will sink into the ground.
Title: Re: More Texture mapping stuff
Post by: TheBadger on January 13, 2012, 03:19:24 AM
Hi Dune, thanks for getting back. Im sorry though, I dont know how to do the things you mentioned.
Title: Re: More Texture mapping stuff
Post by: Dune on January 13, 2012, 03:33:05 AM
Check this out.
Title: Re: More Texture mapping stuff
Post by: bobbystahr on January 13, 2012, 03:48:48 AM
Quote from: TheBadger on January 13, 2012, 03:00:48 AM
Hi,

Ok, I had a file to render to help make my question clear, but somethings not working with it. Anyway, my question is, I have a some what flat-ish terrain, through out the terrain are what look like drumlins. I like every thing about the image, but for one hill. I would like to use an image map to make the hill more or less go away. Can it be done, and how?

You could try a Paint Shader...Paint the hill in top view with a big enough brush to cover the whole thing, then load a Surface layer, disable Colour, and then load the Paint shader into the Displacement Tab's Displacement function field and set Displacement multiplier to a large-ish negative number -100 for example. That may be too much or not enough but the number to adjust is the multiplier.
That's what I'd try......
Title: Re: More Texture mapping stuff
Post by: Dune on January 13, 2012, 03:55:06 AM
I beat you, Bobby  :D :D
Title: Re: More Texture mapping stuff
Post by: bobbystahr on January 13, 2012, 04:08:30 AM
I was at a gig and had just sat down and not typing quite fast enuff, heh heh heh
Title: Re: More Texture mapping stuff
Post by: TheBadger on January 15, 2012, 06:40:11 PM
Hi Dune. Thanks for the file. I haven't had a chance to look at it yet, but I wanted to make sure and acknowledge your help. I'll let you know if I can understand it.
Title: Re: More Texture mapping stuff
Post by: TheBadger on January 28, 2012, 08:19:19 PM
@dune. Thank you. I think i can use this.