Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by chrs · Oct 19, 2014 at 07:58 PM · splatmapsplat

Splatmap , i dont get it.

Im searching for 2 days now, read hundred of threads and tutorials, still cant find anything. Simple Task: Make a Platform / Terrain in Blender import to Unity. Now i just wanna use different TILED Textures on this. All i can find is: Buy "insert random name" Plugin, use Terrain-Tool ... I cant use the terrain tool because i can not shape it like i need it (simple rounded platform).

In the best case i can build the platform in blender, use texture paint to paint the different textures and import it somehow in unity.

Is it really that hard or did i miss something ? I know i can bake the texture but i want them to be tiled. Just different texture based on a RGB map or whatever with smooth edges like shown here as example.

Anyone can help?

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by s d · Oct 26, 2014 at 02:05 PM

i feel your pain, i also been looking for a way to do this but i dont think its possible from blender. the problem is blender doesnt seem to have a way to export an image with RGB(A) colours which are needed for the splatmap[1]. the best it can do is using a stencil-technique[2] it can export an image with B&W colours at which point it could be used with a proper shader in unity, a 2 texture limited splatmap kind of thing. but since its limited to 2 per mesh you would have to separate it into parts when you need new textures so its really not the best option, at least for a whole terrain.

i think the easiest option would be to make the mesh in blender, unwrap it then find a plugin (most likely not free) that allows you to create a splatmap and paint it inside unity just like the terrain but for any mesh instead.

[1] it would be technically possible to paint only Red Green and Blues onto your terrain (lets say red for dirt, green grass and blue rocks) then use this image alongside this shader forum.unity3d.com/threads/shader-experiments.181486/ but you cant see the final painting result until its imported into unity (theres no way that ive found to swap painted textures from say "real textures" to "RGB image for unity")

[2] http://vimeo.com/15679785 if you decide to use this technique turn Shading to GLSL in the "N" menu of blender

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 chrs · Oct 26, 2014 at 09:00 PM

Thanks for your answer, i cant get the shader from your link running, i keep getting errors but im not sure if it really does what i need. What im doing at the moment is using an Shader i found.

Works ok, but i need the corners of the platform to use transparency (Grass should hang over) and again im searching for days to make it work.

I tryed with the TerrainTransparency Shader from the wiki but if i add an transparent PNG as Texture its always white.

Im really surprised how hard it is, i thought this will be the simple part of my project. All i need is a Shader that allows me to paint different colors for different tiled textures and a color or alphamask to make some parts of the mesh transparent.

 Shader "4TextureBlend"
 {
     Properties
     {
         _Control ("Control (RGBA)", 2D) = "red" {}
         _Splat3 ("Layer 3 (A)", 2D) = "white" {}
         _Splat2 ("Layer 2 (B)", 2D) = "white" {}
         _Splat1 ("Layer 1 (G)", 2D) = "white" {}
         _Splat0 ("Layer 0 (R)", 2D) = "white" {}
         // used in fallback on old cards
         _MainTex ("BaseMap (RGB)", 2D) = "white" {}
         _Color ("Main Color", Color) = (1,1,1,1)
     }
    
     SubShader
     {
         Tags
         {
             "SplatCount" = "4"
             "Queue" = "Geometry-100"
             "RenderType" = "Opaque"
         }
        
         CGPROGRAM
         #pragma surface surf Lambert vertex:vert
  
         struct Input
         {
             float2 uv_Control : TEXCOORD0;
             float2 uv_Splat0 : TEXCOORD1;
             float2 uv_Splat1 : TEXCOORD2;
             float2 uv_Splat2 : TEXCOORD3;
             float2 uv_Splat3 : TEXCOORD4;
         };
  
         void vert (inout appdata_full v)
         {
             float3 T1 = float3(1, 0, 1);
             float3 Bi = cross(T1, v.normal);
             float3 T = normalize(cross(v.normal, Bi));
            
             v.tangent.xyz = T.xyz;
            
             if (dot(cross(v.normal, T),Bi) < 0)
                 v.tangent.w = -1.0f;
             else
                 v.tangent.w = 1.0f;                
         }
        
        
         sampler2D _Control;
         sampler2D _Splat0,_Splat1,_Splat2,_Splat3,_Splat4,_Splat5,_Splat6,_Splat7;
        
         void surf (Input IN, inout SurfaceOutput o)
         {
             fixed4 splat_control = tex2D (_Control, IN.uv_Control);
             fixed3 col;
             fixed3 nor;
            
             col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb;
            
             col += splat_control.b * tex2D (_Splat1, IN.uv_Splat1).rgb;
 
 
             col += splat_control.g * tex2D (_Splat2, IN.uv_Splat2).rgb;
 
 
             col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb;
 
            
             o.Albedo = col;
             o.Alpha = 0.0;
         }
         ENDCG  
     }
    
     // Fallback to Diffuse
     Fallback "Diffuse"
 }


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

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.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Is this a bug or a my misunderstanding how terrain textures work? 0 Answers

Different renders of Terrain Splat Protypes in Real Time 1 Answer

Deleting terrain splatmap through scripts. 1 Answer

Modifying Terrain Splat Texture at Runtime 2 Answers

How can I get two different terrain instances to use different splat maps? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges