Tiling Textures on Objects - How do you Hook up the Textures?

Started by D.A. Bentley (SuddenPlanet), May 02, 2019, 10:19:10 PM

Previous topic - Next topic

D.A. Bentley (SuddenPlanet)

Textures aren't automatically loading into Terragen on my objects even though I have them in the MTL file (processed through Poseray).

How do I get my textures to show up, and I need them tiling so I need to use something like an Image map shader, since the Default Shader doesn't even have tileing options for textures.


Help please.  I'm in a crunch!

-Derek

D.A. Bentley (SuddenPlanet)

On top of that UVs aren't working properly in Terragen 4.418.

My object UV's are correct in Modo, and Poseray but when in Terragen it's progecting like "Side Z (edges = XY)" when set to "Object UV (if available)"

Still waiting on how to set up tiling textures on objects...

-Derek



D.A. Bentley (SuddenPlanet)

My textures although not tiling yet show up on my object in the Shader Preview but they are not rendering.  I just get the flat shaded color in the material and not the image texture.

Dune

Same answer as in your other thread. Check repeat X and Y. I often use a combination of default shader and image maps to texture my objects. Color used before the default (input) will be overwritten by the default though, so you can use it afterwards or merge or add as child to surface shader after the default. Many ways...

D.A. Bentley (SuddenPlanet)

Quote from: Dune on May 03, 2019, 02:00:57 AM
Same answer as in your other thread. Check repeat X and Y. I often use a combination of default shader and image maps to texture my objects. Color used before the default (input) will be overwritten by the default though, so you can use it afterwards or merge or add as child to surface shader after the default. Many ways...

I tried the Image map shader in the color function spot and it didn't work.  My object just still was shaded with a solid color.  Are you saying to plug in the image map shader somewhere other than the color function in the Default shader?


Dune

It should work. Did you set repeat (needed if your UVmap is outside its boundaries) and UV? Other option would be to use the image map shader directly into the part, forget about the default shader.

D.A. Bentley (SuddenPlanet)

I got it to work on a cube just barely.  Terragen keeps crashing when making or duplicating Image map shaders.  I'm trying to put together a simple example scene, and still getting crashing.  Not sure how anyone does any serious material work with all this instability.

D.A. Bentley (SuddenPlanet)

There is something messed up in Terragen as far as how planer projection and UV's work, and how they display in the Shader Preview window compared to how they render.

[attach=1]

I was able to planer project a tiling texture on top of this cube, but can't get it to work on my imported OBJ objects.  Even using my UV's on the OBJ object is not working, and the shader preview is showing the texture all garbled.

[attach=2]

The xFrog tree in the scene has a tiling texture, but is just doing that using UV's going beyond the 0,1 space (Just a default shader with the texture).  Is that the only way to do tiling textures on objects in Terragen?

-Derek

Dune

I see that you have UV set, but the size is 100x100, should be 1x1. Hope that will help.

D.A. Bentley (SuddenPlanet)

Nope that wasn't it.  I'll put together a test scene I can share.  Should be here within the hour.

-Derek

D.A. Bentley (SuddenPlanet)

OK here is the test scene.  Took longer than I thought to make (surprise surprise!)

Basically I am having two issues.  One issue was solved by me figuring out how to expand my UV's to force a texture to tile.

The other issue (1) is if I use Plan Y projection and tile my texture with the image repeat feature in the Image map shader the object renders black (Although the shader preview correctly shows the tiling texture.)

The second issue (2) is sometimes a correctly rendering texture doesn't properly display in the Shader Preview.

I'm using Terragen 4.4.18 which is the latest Frontier Build.

To illustrate Issue (1) open the Test Scene and render it.  Notice how the geometry ground object renders black.  It's using an Image map shader plugged into the Color function slot of that material.  To find that material go inside the TestObject_01.obj node, and continue down through the Parts Shader and you will see the material named MAT_Land shader has an Image map shader attached.  The goal here is to bypass the UV's on the object and just use Planer Projection so I can more easily adjust the tiling frequency by adjusting the texture size.  In this test scene I have the size set to 100, and the Shader Preview correctly shows it but as i said the object renders black.

To illustrate Issue (2) you can open any of the other materials with no Image map shader attached and click the Shader Preview icon to open a preview.  The Building_Sides shader material is a good example, and can easily be seen.  The object in the scene renders correctly, but the Shader Preview is all messed up (Looks like Stripes) no matter how far you zoom in/out.

I can work around these anomalies but both of these issues cause headaches, and work slow downs.  I would like to know if they are bugs or if there is a way to fix these issues.

Thanks,

Derek




Oshyan

For issue #1, I can't reproduce it showing up correctly in either RTP or the regular 3D preview, in RTP it's black, in regular preview it's pink for some reason (probably outscaled texture?). Anyway, switching the Image Map Shader to use Object UV instead of Plan Y fixes it. Also note that you do not *need* to use a Default Shader, you can plug the Image Map Shader in directly, unless you need some features of the Default Shader.

Issue #2 is just an example of a limitation with the current material previews, basically. There is no workaround that I'm aware of except to temporarily change the Projection to e.g. Through Camera, which will allow the texture display correctly, but then won't work for rendering. It's a known limitation and certainly should be improved at some point.

- Oshyan

cyphyr

Try this.
In the default shader unhook the image map shader from the default shaders input, load the GroundTile_01.png into the default shaders Colour image slot and go to the last tab  "Images" and select "Object UV (if available)"
Ahh I see I miss understood your question ...

Unless I am still misunderstanding you actually all you have to do is change the size of the uv tiling in the image map shader.
Don't use Plan y, use uv tiling and scale the tile accordingly.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

D.A. Bentley (SuddenPlanet)

Thanks Oshyan & cyphyr!  I wasn't having much luck changing the image size setting when using UV's but it's good to know that should work.  It's also good to know the Image map shader can be directly plugged into the Material node (bypassing the Default shader).  I just hope when I delete the Default shader Terragen doesn't crash.  ;)   I'll give these tips a shot and see where I end up.

I think the main problem was trying to use Play Y (Planer Projection).  It seems using UVs is much more reliable & predictable.

Lets just hope I can get everything I need done by Monday.  I'll be working straight through the weekend I bet.

-Derek

D.A. Bentley (SuddenPlanet)

Quote from: cyphyr on May 03, 2019, 05:07:38 PM
Try this.
In the default shader unhook the image map shader from the default shaders input, load the GroundTile_01.png into the default shaders Colour image slot and go to the last tab  "Images" and select "Object UV (if available)"
Ahh I see I miss understood your question ...

Unless I am still misunderstanding you actually all you have to do is change the size of the uv tiling in the image map shader.
Don't use Plan y, use uv tiling and scale the tile accordingly.

In your example do you have Repeat x / y checked on under the Flip, Repeat Tab?

Still having some issues getting this to work...

Thanks,

Derek