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 - virgilw

Pages: [1]
1
Support / Re: MipMap setting lost on generated texture
« on: December 07, 2014, 02:26:30 pm »
Actually, it looks like the mip map settings are being pulled from the "Texture Settings" part of the collection editor.  It uses whatever you put there (whether you check the box for mipmap or not) for the output texture atlas and for the linked texture atlases.  So that may be working as you intended...

I was initially confused because I changed the texture type of my linked texture atlas to "normal map".  And then I got it in my head that tk2d was preserving whatever changes I had made to that texture whenever it created a new one.  I thought it might read all of the settings on the output texture if it existed, then put them back.  That may be true for the texture type, but not for mipmap, aniso, etc.

Anyway, I'm fine with having the output texture and all linked textures have the same settings, so this is no longer a work flow issue for me.

2
Support / MipMap setting lost on generated texture
« on: December 06, 2014, 03:18:02 pm »
I'm using the linked sprite collection functionality (again, awesome).  For the output atlas that gets generated I have set it to be a normal map, grayscale, and enabled mipmaps.  I've attached an image that shows the settings.

I then go and rebuild the atlases by clicking "commit" in the sprite collection editor.  This does everything great, but the mip map setting on the atlas for the linked sprite collection gets reset to off.  I've attached an image that shows what the settings look like immediately after clicking "commit".

I have not tested this with other textures with other settings.  I suspect it doesn't have anything to do with being a normal map, or a linked atlas... but I don't know that.  I also have only tested with Unity 4.6.0.  So this could be a problem with Unity 4.6.  A quick look at your source seems to show mipmap settings, but before I look deeper I thought I mention this to see if it is a known issue.
--edit--
Not sure you you allow image attachments.  They are attached to this post in the editor, but I can't see them when viewing the post.

3
Support / Re: Tangents
« on: December 06, 2014, 03:09:00 pm »
I did some further research and basically "it depends".  The Y axis of a normal map can be either way and different sofware generates normal maps either way.  Blender does it one way, other things do it other ways.  For instance: http://answers.unity3d.com/questions/28850/tangent-normal-map-produces-reversed-effects.html

Looking at a app like Shader Map 2, it defaults to the "Standard" but you can flip it easily (on any axis).

In the case for Unity, it looks like they are converting grayscale height maps the same way Blender might.  That makes the default tangent in tk2d be inverted.  For anyone using an external tool like Shader Map, the default output normal map would be correct.

Long story short, it would be cool if there were a little checkbox under "create normals and tangents" that said 'invert tangent".  This would cause the tangent to be 1,0,0,-1 rather than 1,0,0,1.    Or, I suppose you could allow full entry of all 4 numbers for a tangent.  Having an option like this would allow folks with normal maps to work with them without having to reprocess all of them to flip the red/green (which is such a chore, it's far easier just to make a code change to tk2d... but then I have to remember to keep doing that every time I upgrade tk2d).

4
Support / Tangents
« on: December 05, 2014, 09:09:23 pm »
I might be dumb here as I just started messing with lighting on sprites, but the tangents that tk2d seems to auto generate are (1, 0, 0, 1).  Should this not be (1,0,0,-1) to work properly with normal maps that Unity imports from height maps? (The normals tk2d generates are (0,0,-1) as expected).

For example start with a grayscale height map, import it into unity, set it as a normal map and check the checkbox for gray scale.  Use that normal map on a sprite with a directional light coming from the top left of the screen.  For tk2d sprites the light appears to be coming from the bottom left.  Now I know I can just edit tk2dSpriteCollectionBuilder.cs and change the tangents that get generated (this works, I've done it), but before I do that and move on I wanted to see if there was something I was missing first.  For all I know Unity's conversion from height map to normal map is upside down. 

(Note that I have the linked sprite collection atlas that tk2d generates set to Normal map, grayscale.  So I'm using Unity's built in grayscale height map to normal capability).


As a side note, I just started using 2DToolkit (like 2 hours ago) and have been using Unity's straight up SpriteRenderer on my current project.  I wanted to use 2dtoolkit because of the linked sprite collections that simplify dealing with normal maps and atlases.  And it seems to do the beautifully.  That alone makes 2dtoolkit  awesome.  Throw in that you can slice sprites and it's a clear winner over the stock SpriteRenderer in Unity 4.6.


Pages: [1]