- Home /
Texture quality differs from EditorGame mode to build Game.
Greetings to all.
In my project, I am creating a terrain "on the fly" during runtime and apply a texture to it. Basically, I want to use a texture stored on a server which i want to apply on the terrain. All is going well with this procedure, I get the data succesfully and create my terrain and also apply the texture.
The problem is that, while when I run the game inside the editor, the texture appears at its normal quality (blurry from far away, but clears when i get closer to the terrain), when I build the game and run it from either the web player or the windows player, the texture remains blurry.
The method I use to create the texture is by using WWW to read the file and then make a Texture2D by calling www.texture.
Is there something I am missing? Maybe some property i should set that defaults in lower quality in built games or something?
Thanks in advance for your answers guys :)
Blurry from afar, but better quality when closer? You mean LOD? If I remember correctly, LOD is a Unity Pro feature. Do you have Unity Pro?
It's a wild guess because I've never encountered this problem.
Try creating a texture first that has mipmaps, assign it to the game object then use WWW.LoadImageIntoTexture to that texture.
Also, check the project quality settings under Edit -> Project Settings -> Quality
First of all thank you for the replies, much appreciated guys. Sorry it took me some time to check them out, i didnt have the chance until now.
@guitarxe Yes, we have Pro, albeit the trial for now, but i am not sure this is a terrain LOD thing. When i pay attention to the detail of the surface alone (as in triangles rendered) they do get better as i get up closer. It is only the image (texture) that remains blurry. Also note that it is a very big image (4096x4096) and i stretch it all over the terrain (it is intentional). What buffles me is the fact that it works great in play-test mode, but not in the built game.
@Saad_$$anonymous$$hawaja, i checked the settings as you said, and let's say under Webplayer on "Good" it lists the following: Texture Quality "Full Res" Anisotropic Textures "Per Texture" Anti Aliasing "Disabled" (I tried to set it to enabled but as expected it is not related). Do you think it could be some other option i am missing?
Also, some help on the mip maps thing: how do i go about doing what you say? do i have to create the mipmaps in an external programm like Gimp? Are they created by Unity during import by some function call? (Also maybe the thing about it being a very HQ Texture which i stretch over the terrain that i mentioned above shed a bit more light?)
Thank you for the help guys!
Ok, so it seems I found where it went wrong, And I will mark it as an answer as soon as I get some more details down. I was setting the BasemapResolution too low (thinking it was something else entirely), but it seems this controls the base Texture Resolution, and I was missing that. I set at the Same quality as the texture (4096), which I do not know if it correct, but at least now it shows clearer. I'll play with these settings a bit, and maybe I will have to figure some algorithm out in order to change resolution levels based on camera distance if such is possible without breaking it :P I'll get back to you as soon as i have something. Any suggestions are welcome :)
Your answer
Follow this Question
Related Questions
How do I extract a texture map from a terrain? 1 Answer
Get texture from terrain. 1 Answer
Weird lines on the grass texture 0 Answers
Access terrains "Alphamap 0" from within code 0 Answers
how do I add texture to the terrain? 1 Answer