Planetside Software Forums

General => Terragen Discussion => Topic started by: sjefen on October 20, 2007, 09:01:50 PM

Title: Texturing/Shading Help
Post by: sjefen on October 20, 2007, 09:01:50 PM
I really don't understand this.

I have a terrain with resolution 4096x4096 and images with the same resolution that I want to use as textures, but I can't figure out how to do this. It never fits. I loaded the terrain, then in shaders, I added a Image Map Shader and set it to Y and the size to 4096x4096 but it doesn't fit.

What am I doing wrong here?
Title: Re: Texturing/Shading Help
Post by: dhavalmistry on October 20, 2007, 09:08:38 PM
try using the option "Position Center" or maybe you can try resizing the heightfield.....
Title: Re: Texturing/Shading Help
Post by: sjefen on October 20, 2007, 09:18:58 PM
I've already tryed that with no luck.
Title: Re: Texturing/Shading Help
Post by: Mr_Lamppost on October 20, 2007, 09:27:17 PM
Ok not tested but my guess would be that you need to set the image map size and centre to match the size and centre of your heightfield generator.

I think the resolution i.e.  4096X4096 of images and height fields (DEM or otherwise), is independent of the size used by TG2
Title: Re: Texturing/Shading Help
Post by: dhavalmistry on October 20, 2007, 09:30:14 PM
but when you first load a heightfield in TG2...its always at 0,0,0

unless he moved it.....
Title: Re: Texturing/Shading Help
Post by: sjefen on October 20, 2007, 09:33:05 PM
I have not moved it. It is at 0,0,0
Title: Re: Texturing/Shading Help
Post by: Mr_Lamppost on October 20, 2007, 09:35:33 PM
I don't usually do this and I know you will not have my lamppost but here is a quick test of the old daytime version projected onto a procedural heightfield.

You will need to both Generate Heightfield and replace the image with one of your own.

tgd included
Title: Re: Texturing/Shading Help
Post by: sjefen on October 20, 2007, 09:38:21 PM
Thank you very much. I will try this.
Title: Re: Texturing/Shading Help
Post by: sjefen on October 20, 2007, 09:57:30 PM
I'm sorry, but it didn't work.
Title: Re: Texturing/Shading Help
Post by: Mr_Lamppost on October 20, 2007, 10:06:07 PM
In the example I posted the image and heightfield resolutions were very close, 1024 and 1000 respectively.  EDIT I just noticed that I had typed 100 not 1000    :-[

Here is a close up of a section of the heightfield this time with the image replaced with the 64 X 64 pixel version of the night time lamppost I am using just now

The only change to the TGD posted was the camera position and the image used.  Believe it or not the white area is the lit lantern
Title: Re: Texturing/Shading Help
Post by: sjefen on October 20, 2007, 10:27:26 PM
I'm not sure I fully understand.
Maybe it's best if you, or someone else take a look at this: http://www.cajomi.de/Forum/showthread.php?t=501 (http://www.cajomi.de/Forum/showthread.php?t=501)
That is what I am working on.
Title: Re: Texturing/Shading Help
Post by: Oshyan on October 21, 2007, 12:25:33 AM
You need to set the size in the Image Map shader to the size of your terrain *in meters*. The default "point spacing" of a Terragen .ter terrain is I believe 30 meters. If the terrain is from Geocontrol I'm not sure how the scale is set (not sure if GC has real world units), but if nothing else you can load it in TG 0.9 and check the total size in meters there (in the Size dialog from the Landscape window). We will of course show you terrain size (in meters) in TG2 itself in the future.

- Oshyan
Title: Re: Texturing/Shading Help
Post by: bigben on October 21, 2007, 10:02:27 AM
Another way to get the numbers (close enough) is to set the terrain's position to lower left at 0,0,0 and then zoom in to the top right corner of the terrain's bounding box. Position the mouse over the corner and read the coordinates at the bottom of the preview window. Remember it's in metres, so if the coordinates are in km you need to multiply by 1000.  X is width, Z is height.

Set image projection to Plan Y and position with the same settings as the terrain...
Title: Re: Texturing/Shading Help
Post by: Mr_Lamppost on October 21, 2007, 06:18:57 PM
I made another test; I brought in an old terrain from V 0.9.43.  The size (Area covered by), the terrain is controlled by the file being loaded.  As Oshyan says all you need to do is match the size of the image map to this. 

Sorry if I was being less than clear yesterday, Before the test I just made I have never imported a terrain so I was figuring it out as I went along.  Virtually everything I do is procedural.