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

Matt

Hi Derek,

You can use the planar projection modes if you use a Transform Input Shader to convert the texture coordinates to world space, enabling "use world space" and putting the transform shader somewhere downstream of the image map shader or the default shader.

Here's the longer explanation: The planar projection modes don't automatically switch to world space, they're still working with the texture coordinates which are defined by your UVs, although the shader thinks they are 3D coordinates rather than 2D. If you're were working on an object where the texture coordinates were generated from world space (e.g. the terrain after a Compute Terrain node) then the planar projection modes would do what you expect. You can generate new texture coordinates using a Transform Input Shader with "use world space" enabled, by putting the Transform Input Shader anywhere downstream of the shader.

The reason it doesn't automatically use world space is so that you can affect them with warp shaders and other transforms which only modify texture coordinates. Perhaps the image map shader would be better with two versions of each of these projection modes.
Just because milk is white doesn't mean that clouds are made of milk.

Matt

There are some crashes which are specific to editing shader inside a Parts Shader. You can prevent this by pausing the 3D preview while working within a Parts Shader.
Just because milk is white doesn't mean that clouds are made of milk.

D.A. Bentley (SuddenPlanet)

Thanks for the detailed explanation Matt.  Now I understand why the Terragen Cube I was experimenting with worked with the Planer Projection (I assume it has no UVs by default).  So the UVs that are assigned to my imported OBJ's were messing up how I thought Planer Projection should work by the sounds of it.  So if I understand you correctly, would it be better to not have any UIVs assigned to an imported object if I plan on using "Plan Y" for example?

-Derek

D.A. Bentley (SuddenPlanet)

OK finally got my textures working like this:

[attachimg=1]

Matt

Quote from: D.A. Bentley on May 04, 2019, 12:25:09 PMSo if I understand you correctly, would it be better to not have any UIVs assigned to an imported object if I plan on using "Plan Y" for example?

If you have UVs you should keep them, and simply bypass them the way you have done. That gives you the flexibility to use the UVs for some shaders and not for others.
Just because milk is white doesn't mean that clouds are made of milk.