Jump to content


Photo

Rotate Texture


  • Please log in to reply
17 replies to this topic

#1 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 16 March 2018 - 01:54 PM

I'm making my way, very slowly, through the Custom Layers tutorials and experimenting at the same time. Is there a way to rotate a texture so mow lines line up with the fairway? Right now they seem to default to being in line with the edges of the terrain.



#2 NoPutt

NoPutt

    Advanced Member

  • Members
  • PipPipPip
  • 2,902 posts
  • LocationSouth Carolina

Posted 16 March 2018 - 02:19 PM

That would be done in Photoshop or Gimp.

You can try this as your shader.

sQC5loN.jpg


Dry Gulch...................Released                     Smithfield Golf Club...........Released

Millstone Golf Club....Released                      The Walker Course............Released

Kingsmill Woods Course...Released               Pine Lake Golf Club..........Released

Woodhaven Golf Club (9) Released                The Reserve at Keowee...Released

Cliffs at Keowee Vineyards..Released              The Ace Club...................Released

Dry Gulch 2..........Released                               Blackberry Oaks.............Released

 


#3 Crow357

Crow357

    Advanced Member

  • Administrators
  • 4,670 posts

Posted 16 March 2018 - 05:41 PM

When I made Castle Pines, I had 4 fairway textures.  One vertical, one horizontal and two diagonal each way.  I tried to match the fairway to the hole using these 4 textures.


Win 10, i7-7700 @4.2 ghz, 16GB DDR4, EVGA GTX 1080
Swing Type: Tour Pro Wireless XBox 360 Controller.

#4 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 16 March 2018 - 06:27 PM

Thanks, I downloaded the graphic. To make sure we are talking about the same thing... There is no way to rotate the resulting texture that is created from the Layers Library where you can add 2 textures and 2 normals? Meaning if I have a bunch of fairways and tee boxes pointing different directions I need a custom layer for each specific tee and fairway (unless they just happen to point the same way)? I guess the alternative is to compromise.

 

I tried rotating the spline but that was not a solution or good idea. It's just a test file so not worried about corruption.



#5 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 17 March 2018 - 03:00 PM

Well that takes some work but I figured out how to get pretty seamless tiling for 5, 10, 15 and 45 degrees. I can then rotate those 90 degrees to get the perpendicular directions. The weird thing is the 15 degree and 45 degree lines go towards the opposite direction of the 5 and 10 degree lines even though the underlying textures were all tilted clockwise. Not sure how Unity manages that but I will need to experiment more. Perhaps it is just user error.



#6 M Rose

M Rose

    Advanced Member

  • Members
  • PipPipPip
  • 1,918 posts
  • LocationMelbourne, Australia

Posted 17 March 2018 - 04:50 PM

Unity won't let you do it; you have to make different textures for each pattern.

That's one of the few things Links' designer did do better - the planar mapping was handy like that.

I've got a template with all kinds of mow lines on different layers that I keep for such usage.

Unfortunately you can't do it for greens; you can only have one green texture. Otherwise you'll get pop-up cups.

VG2 • PG • 2k21 • 2019 • Links • GBC • JN5


#7 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 17 March 2018 - 06:51 PM

I'm curious if your mow line templates are square textures? I'm trying to figure out why some of mine are slanted in the opposite direction of the underlying texture.



#8 Crow357

Crow357

    Advanced Member

  • Administrators
  • 4,670 posts

Posted 17 March 2018 - 08:33 PM

They should always be square and sized to a power of 2 (ie 512x512, 1024x1024, 2048x2048, etc)
Win 10, i7-7700 @4.2 ghz, 16GB DDR4, EVGA GTX 1080
Swing Type: Tour Pro Wireless XBox 360 Controller.

#9 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 18 March 2018 - 01:50 AM

It certainly works with non-square textures but your post influenced me to research the 'why' of your comment. From what I can tell Unity will convert a non-square texture into a square texture for compression of file size reasons. That would seem to explain why some of the slant angles are wrong. It may also convert it to a power of 2 size but I am not certain on that. I can confirm that the file size of the test project has ballooned as compared to some completed courses and the test file only has 11 splines.

 

I have no issues, so far, on my PC but at the rate it is going I am not sure how it would perform if I were to continue along that path. This course also has a very large amount of tall fescue and I a worried how that might impact file size.

 

So I will have to go back to the drawing board on getting mow lines at many different angles to match the course layout. I'm not sure it will be possible. I suppose I could export the height map and image overlay to cut out each hole plus surroundings individually and then Frankenstein together a course layout where everything lines up either perpendicular or parallel to the terrain edges. That would be very time consuming and since it is a links style course probably not very effective. You can see too many other holes from each fairway.

 

I also have another issue that I haven't even tried to tackle yet which is one hole where the number of mow line changes is just 1 (ie. the right side of the fairway is cut in the opposite direction of the left side with the dividing line down the middle of a slightly winding fairway).



#10 M Rose

M Rose

    Advanced Member

  • Members
  • PipPipPip
  • 1,918 posts
  • LocationMelbourne, Australia

Posted 18 March 2018 - 03:37 AM

I have a 1024 x 1024 in a Photoshop document. There are mow lines in four directions and four thicknesses; all on their own layers - I just turn them on and off and save into a new image depending on the pattern I want to use.

VG2 • PG • 2k21 • 2019 • Links • GBC • JN5


#11 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 22 March 2018 - 02:47 AM

I've made some progress but having a little issue with sizing of the mow lines. It occurred to me that it would be much simpler if I could just use the mow line image with transparency set as one of the textures in the Layers Library. Unless I am missing it that doesn't seem to be available for the Course Forge meshes.

 

At least I am getting a little more comfortable with the LL.



#12 M Rose

M Rose

    Advanced Member

  • Members
  • PipPipPip
  • 1,918 posts
  • LocationMelbourne, Australia

Posted 22 March 2018 - 05:00 AM

Yes, originally I used to set mow lines onto the grass texture itself, back in the Links days, because that was the only way to do it. The nice thing about the library now is you can make the mow lines as their own texture, and obviously change the size of the mowing stripes independently of the grass texture.... or simply swap them out with a different pattern.


VG2 • PG • 2k21 • 2019 • Links • GBC • JN5


#13 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 22 March 2018 - 01:12 PM

Oh, that hadn't occurred to me yet. I have been creating one texture like you used to do back in the Links days. So your mow line image is Gray for the mow lines and you use a light color for the gaps? Does white influence the color of the grass texture or are you using a greenish/grayish color for the gaps to influence the grass texture color? I will have to try it when I next get a chance.

 

That might mean I can have my mow lines at any angle and keep the mow line file small. If I can avoid the necessity to keep the mow line file square and a power of 2 that would make things much easier. For angles that easily repeat with a square/power of 2 size restriction they could be at near full size as they will be compressed and then angles that are harder/impossible to convert to square/power of 2 could be stopped at 1 repetition of Stripe/Gap and still be a small file size even though they aren't being compressed.

 

Then again I won't trust anything until I can experiment with it. Every time I think I am getting there it turns out I am not.



#14 shimonko

shimonko

    Advanced Member

  • Members
  • PipPipPip
  • 1,718 posts

Posted 23 March 2018 - 05:33 AM

The normal way to do this in gaming engines is via decals. Unity doesn't haven in-built decals (a few third party options though), but it does have something very similar inbuilt - projectors. They allow you to scale and rotate at will.

These are cart tracks I made using decals - I can't however recall if I needed tricks to get them to show in the actual game. So recommend investigating the inbuilt projectors - see how much they drag performance down. Also I haven't got CF open but I see with projectors one can ignore layers, but not objects - so it would need the fairway splines to be on a different layer to the rest so the mow lines can go right to the edges of the fairway. I can't recall if that is the case. Never tried projectors--so I'm speaking hypothetically.

WWZty5Eh.png


Here's a vid on projectors.





 



#15 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 24 March 2018 - 05:19 PM

With 2 projectors it is displaying correctly int Unity but not in JNPG. The Fairway and Rough are on separate layers and it may not like that. I may need to put a cut-out in the rough but am experimenting with other things first.

 

And how do you get a YouTube video to display inside the post on this site? I know I have posted in the past and It has worked but it seems very hit and miss. 

 

Edit: Just for my future reference the video link needs to be pasted directly into the message body, not using the link function in the forum editor, and it needs to be in MS Edge or Chrome since pasting does not work on this forum when using IE (did not try Firefox).The video may or may not need to be Unlisted rather than Public on YouTube.



#16 shimonko

shimonko

    Advanced Member

  • Members
  • PipPipPip
  • 1,718 posts

Posted 25 March 2018 - 02:46 AM

That's a pity - thanks for trying it out. YouTube use youtube.com version of the link, rather than the youtu.be version.
 

https://www.youtube.com/watch?v=yO6SOEz6hEU


#17 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 25 March 2018 - 06:56 AM

I was going to just make one graphic that would be my single fairway stripe split down the middle and rough mow lines to avoid he fairway disappearing issue. However, I ran one last test, this time actually playing the hole, only to realize the Pause Render on Swing setting stops the projection. That makes this approach unusable IMO. It was worth a shot.



#18 grumpter

grumpter

    Advanced Member

  • Members
  • PipPipPip
  • 157 posts

Posted 28 March 2018 - 01:33 PM

Making a last ditch attempt at the easy way I was trying to get a texture to be usable when set to clamp but that does not appear to be possible with Course Forge. Has anyone found a way to use a texture in the Layers Library set to clamp rather than repeat? Trying to get a texture set to repeat once, perfectly online, seems almost impossible but I could be missing something obvious.

 

The Projectors might come in handy after all. The grid projector seems like it will be useful and hopefully you can set it to the current view like you can the camera. I will have to experiment with that. If the rough mow lines have to be done the hard way (drawing each rough mow line as a separate spline) I might also be able to use the projector blob/light for the layout, but not the build version, to project where my rough spline lines should be drawn to get a similar look as the video I posted.

 

The stripe down the fairway will be easy enough.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users