- Home /
Terrain Texture Android And OpenGL ES 1.x
Hi all. I m looking to solve my problem.
I m making a simple game to android and the terrain have a big problem.
The terrain texture have a big pixels and blurry.
I m using OpenGL ES 1.x Texture: Grass Hill size 512X512. I have no chance to solve this problem alone, Can you help me?
Answer by cod · Sep 11, 2013 at 03:46 PM
what shader are u using? the built-in or an other? go to edit->graphic emulation and tell me the avaiable emulation(shader model 3, 2, 1, dx7)
for what I can see, it seems that your shader can't run on this machine, so it just switch to the diffuse shader using the global colormap
How many textures are u using on this terrain?
Just write a comment with all the infos and I'll find a solution :)
hi man. I have only two avaiable emulation OpenGL 1.x and 2.0. i have only one texture in this terrain.
what shader are u using? For this question, where can i see shader?
try this simple shader
Shader "Hidden/TerrainEngine/Splatmap/Realtime-FirstPass" {
Properties {
_Control ("Control (RGBA)", 2D) = "red" {}
_Splat0 ("Layer 0 (A)", 2D) = "white" {}
_Splat1 ("Layer 1 (B)", 2D) = "white" {}
// used in fallback on old cards
_$$anonymous$$ainTex ("Base$$anonymous$$ap (RGB)", 2D) = "white" {}
_Color ("$$anonymous$$ain Color", Color) = (1,1,1,1)
}
SubShader {
Tags {
"SplatCount" = "4"
"Queue" = "Geometry-100"
"RenderType" = "Opaque"
}
CGPROGRA$$anonymous$$
#pragma surface surf Lambert
struct Input {
fixed2 uv_Control : TEXCOORD0;
fixed2 uv_Splat0 : TEXCOORD1;
};
sampler2D _Control;
sampler2D _Splat0,_Splat1;
void surf (Input IN, inout SurfaceOutput o) {
fixed4 splat_control = tex2D (_Control, IN.uv_Control);
fixed3 col;
col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb;
col += splat_control.g * tex2D (_Splat1, IN.uv_Splat0).rgb;
o.Albedo = col;
o.Alpha = 0.0;
}
ENDCG
}
// Fallback to Diffuse
Fallback "Diffuse"
}
it should work, let me know
EDIT: I made some mistake, now it is fixed :)
ok. i have create this shader but, where put this? sorry for my noob answare :'(
I edited the code, now is correct
It basically replaces the builtin terrain shader and should work
if it doesn't try to modify the texture tiling values
hi. now i have your code edited, into shader file. but if i drag and drop shader into terrain inspector this this not attach. How to replaces the terrain shader?
Your answer
Follow this Question
Related Questions
Texture problem android 0 Answers
Odd Ground ( terrain ) texture appearance 0 Answers
Change terrain texture colour 1 Answer
Can't find the paint / raise / lower terrain setting in unity 2018.3 1 Answer