Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - boehmz

Pages: [1]
1
Support / Re: Grey Edge on Corner of BlendVertexColor Sprites
« on: December 03, 2012, 02:05:58 am »
Solved it through padding

2
Support / Grey Edge on Corner of BlendVertexColor Sprites
« on: December 03, 2012, 01:25:37 am »
When I use a tk2dSprite in the game with the shader "BlendVertexColor", there appears a one pixel width gray edge around the sprite.  This does not appear when the edge has alpha of 0, just for sprites with color up to the edges.




Also, thanks for the help earlier on renderqueue.  Simply switching to sharedmaterial instead of just material worked, felt like thanking you in this topic instead of bumping my other topic.

3
Support / Changing RenderQueue at Runtime
« on: November 28, 2012, 09:13:12 pm »
For my main character, I want him to show up in front of everything else on screen as a black silhouette if he's completely behind an object but not if he's only partially covered.  I'm trying to modify the renderqueue value to be in front of everything else when he is covered and have the same value as everything else when not.

Code: [Select]
Debug.Log("render queue = " + anim.renderer.material.renderQueue);
if(Physics.Raycast(ray, out hit))
{

if(!hit.collider.gameObject.GetComponent<ProtagonistScript>())
        {

       if (anim.color != Color.black)
      {
        Debug.Log("increasing render queue");
anim.renderer.material.renderQueue += 15;
anim.color = Color.black;
}
}
else if (anim.color != Color.white)
{
                Debug.Log("decreasing render queue");
anim.renderer.material.renderQueue -= 15;
anim.color = Color.white;
}

anim is a tk2dAnimatedSprite.
When testing this, when I walk behind an object I see the "increasing render queue" called and the "decreasing render queue" call when I walk out from behind it.  But the main character never gets drawn on top and the renderqueue always gets printed at the same number.

Am I not changing render queue value properly?  My other option is to make another shader with a different renderqueue value and change the shader, but I imagine dynamically switching shaders at runtime would be a performance issue.

4
Support / Re: Isometric Draw Order Problem
« on: November 12, 2012, 06:28:41 am »
Nevermind, was replacing the tiles with prefabs.  I think I got this all worked out. 

5
Support / Re: Isometric Draw Order Problem
« on: November 12, 2012, 02:06:20 am »
Even when making layers of tiles, the lower layer sometimes gets drawn on top when viewing the tilemap not completely top down.



Uploaded with ImageShack.us

That is an example of a tilemap with all red tiles on the top layer and all blue tiles on the bottom layer.  At about halfpoint, the blue tiles get drawn on top of the red tiles.

I'm fairly fluent at rendering techniques, what files handle the batching of draw calls?

6
Support / Re: Isometric Draw Order Problem
« on: November 09, 2012, 01:52:53 am »
Seems like a tricky problem.  We want our character to be able to walk to the back of an object and still be on top.  Currently we kinda hack it by putting the floor objects way below(since it's orthographic, and camera angle doesn't change).  Any tips you can think of to get around it through shaders or any other draw settings?

7
Support / Isometric Draw Order Problem
« on: November 08, 2012, 05:08:32 am »
In an isometric view, when a small sprite goes far away enough from the camera from a larger sprite that it's supposed to be on top of.

The main character gets drawn underneath the floor at the back here:


But in the editor, moving the camera to a side view shows he's clearly on top.



Basically I want to order draws by y-position only(I think, maybe there might be some weird exceptions case even with that).  I'm using orthographic camera with rotation of 45,45,0 euler.

Pages: [1]