• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by TheAnigman · Apr 19, 2016 at 04:56 AM · terrainshaders

is it possible to change shader of terrain details/billboards?

i have a billboard texture which looks great when just applied to a quad as standard material.

but when i use same image as a detail texture it seems downsized, no edge fidelity (soft edges are cropped off) and isnt lit, or casting shadows

i understand these adjustments will be to increase performance and the alpha cut off threshold is removing any soft edges

is there a way to override the material shader of details so they appear same/closer to a normal shader?

but still use unity's detail drawing for distance/quantity etc?

alt text

(quads are in foreground, painted details behind)

any help appreciated, thanks i been searching for where the shader is even located in project folder to see if it can be edited manually but i cant even seem to find which shader file for this purpose?

capture.jpg (147.4 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TheAnigman · Apr 18, 2016 at 10:23 PM 0
Share

not sure if the cropping at the base is because of alpha cut off

or if somehow a difference in detail-texture setting has hacked the bottom off

either way i now have a ruler-straight edge

where with standard shader my soft edge is visible?

4 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Edwige · Feb 22 at 01:21 PM

In case someone has the same issue with URP, here is my solution for 2019.4.13: https://forum.unity.com/threads/2019-2-overriding-shaders-of-terrain-grass.725294/page-2#post-6863873

Hope it helps :)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TheAnigman · Feb 22 at 04:30 PM 1
Share

thank you for taking time out to update with a follow up, and sharing the knowledge

avatar image Edwige TheAnigman · Feb 23 at 07:42 AM 0
Share

Happy to help :)

avatar image
1

Answer by DougRichardson · Nov 04, 2017 at 02:19 AM

One approach is to use the built in shader source code as a starting point and then make modifications from there. Here's how:


  1. Download built in shader sources for your version of unity from the unity archive page. Select the Downloads drop down menu and then choose Built in shaders.

  2. Exract the downloaded shaders zip to a folder.

  3. Drop the folder into your unity assets.


At this point the downloaded shaders you dropped in will override the built-in shaders because they have the same names as the built-in shaders.


To modify the grass billboard shader in Unity 2017.2.0f3, find the WavingGrassBillboard shader located in the builtin_shaders-2017.2.0f3/DefaultResourcesExtra/TerrainShaders/Details folder.


WavingGrassBillboard Location in Project


Here's an example changing the shader to output red instead of the texture color.

Before and After Grass Shader Modification


capture2.png (25.6 kB)
untitled-1.png (218.7 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by HowlingMoonSoftware · Apr 01, 2017 at 08:11 AM

If you name your shader the same as the one Unity uses, yours will override it.

For example: "Hidden/TerrainEngine/Details/Vertexlit"

In your case, you'd want the one used for grass.

Source: https://forum.unity3d.com/threads/terrain-detail-mesh-normal-map.176806/

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jensle · Jun 19, 2020 at 04:38 PM 0
Share

Does this also work in newer versions of Unity? I tried to replace the Internal-DeferredShading Shader, but Unity wont use the altered version.

avatar image
0

Answer by TheAnigman · May 31, 2017 at 12:10 PM

@HowlingMoonSoftware thanks for the reply! (only just had notification of this) And the link :) (hoping i can now make some progress with better vegetation because the stock shader is well limiting with the no shadows and the fact it slices the base off everything creating the sharp edge is frustrating when been careful to not have that on source texture)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image runelink · May 31, 2017 at 01:58 PM 0
Share

I can recommend SE Screen space shadows by Sonic Ether if you're just looking for shadows on the grass. Performance is great and it looks fantastic.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why do Unity 5 is glitched as hell? Please, I need help... 0 Answers

A problem with cutting holes in objects (terrains) using depth mask 0 Answers

How do I set a Terrain object's Grass Texture's material? 0 Answers

Shader: Mesh with Grass and Wind 1 Answer

So I Have a planetary Terrain Shader Problem "Upgrade" (Anyone willing to help?) 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges