- Home /
Render Two texture IOS not using Blend
I am in confusion, like i have Game environment as 2D , with two or more textures(max 7) to be rendered one by one above of the each other, but every texture to be in same quality as like original texture quality there should not be any decay or Blend. So here is the problem, i have to go with custom shaders or with scripting. My targeted platform is IOS and Android devices. In this user may be selecting the textures randomly and to rendered in every frames, if textures are changed. So it should not affect the performance as well.
Thanks in advance.
I don't understand what you are saying, plus I don't see a question here. Are you looking for a specific shader? Why does the shader have to have two textures if you don't want them to blend in any way?
as simple : say for example i have TexA, TexB , TexC. i want TexB and TexC on TexA. In this all Texture to be in same quality. What the shader i can use for this?
Hope now its clear!
Thanks in advance.
What does "TexB and TeC on TexA" mean? Are they combined in some way? Is their transparency on some of the textures? In other words, what do you need the shader to do that requires it to have more than one texture?
Note that quality has many factors that are not part of the shader such as your import settings and whether you setup your game object to be pixel perfect.
TexA, TexB and TexC are transperent Textures, i just named it. I don't know how to combine them. weather i have to use shaders or by using script for combining in run time.
There are lots of ways of "combining," and without knowing more, it is difficult to suggest solutions. You can create several planes and display different images on each plane. You can combine textures in a shaders in a huge variety of ways.
Again, your question focused on "quality." I find that quality has far more to do with how I import the images and how I display them than which shader I use.
Answer by robertbu · Feb 23, 2013 at 03:53 PM
For a dress-up app, I'd use one plane for each type of clothing...one for the shirt, one for coat, one for a pair of sox, one for a pair of shoes... You can change out the textures dynamically, so if you wanted several different types of shoes, you would change the texture for the plane to that pair. Your one potential issue is with this solution is draw calls. If the number of dress items visible at once is lage, you might have a performance issue.
One solution to the draw call issue is to invest in an interface package like EZGUI or NGUI. We use EZGUI. These packages make it easy to create a texture atlas out of all your images which means that instead of a separate draw call for each image, you will have a single draw call for all of your images. In EZGUI you can also use the PackedSprite class to store all the images for one type of clothing and just chose the frame to show at runtime.
Thanks robertbu! i agree n go with your point, by using one plane for shirt. i have task like, when user select two or more textures for having the different designs for his shirt. So i have to show like, combing those selected texture in one plane. i.e selected textures ( 2-4)have to be rendered in shirt plane. So how can i achieve this ?
Thanks in advance
As a starting point, use the following import settings
Texture Type: Advanced
Generate $$anonymous$$ip $$anonymous$$aps: off
Format: RGBA 32
$$anonymous$$ax Size
Next you will need a new material. Give this material Unity's Unlit/Transparent shader. I'm not sure how friendly this shader is for mobile, so you may need to change it later. You can use this material for all your planes.
For the planes to put the textures on, you can use the standard plane. Note that planes are one sideded, so you have to rotate them the right way. Usually I rotate these planes -90 on the X axis. A better alternative is to use the CreatePlane script found here. It allow to to create a vertical plane, and the planes are only two triangles.
Now you need to create a script to display one texture from a set of textures. There are a couple of ways to approach this problem. The easiest is to have an array of textures statically attached to the plane.
There is a script here:
http://answers.unity3d.com/questions/392517/introduction-movie.html
It displays a series of frames as an animation. You attach it to an plane game object, select it in the hierarchy, set the number of entries in artex in in the inspector, and then drag and drop textures onto the slots in the array. Play with it some, then you can modify it so that you can specific a specific texture from the array to show.
Another way to load images onto the plane is to store them in the Assets/Resources folder and use Resources.Load() to load them.
Thanks for info. I will work it out and let you know the result.
Your answer
Follow this Question
Related Questions
iOS shader scale issue 2 Answers
Unity iOS Graphics are bad 1 Answer
Black streaks on iOS 0 Answers
device.present lag iOS iPad1 0 Answers
iphone album art how? 0 Answers