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

Pages: [1] 2
1
Support / Re: 2d face on a 3d model, possible to use 2DTK?
« on: December 02, 2016, 10:08:41 pm »
NICE! Got it working, it even works with multiple atlases. Thanks for the help :D

I hardcoded our Tiling to .25f, since all our face sprites are 1024x1024.

The subclass was as simple as this:
public override void SetSprite(tk2dSpriteCollectionData spriteCollection, int spriteId) {
        var spr = spriteCollection.spriteDefinitions[spriteId];
        var renderer = GetComponent<SkinnedMeshRenderer>();
        renderer.material = spr.material;
        renderer.material.mainTextureOffset = spr.uvs[0];
    }


And if you have more than 16 frames, can enable "multiple atlases" and it works great.



There were a couple tweaks I had to make to the source to get everything to work properly.

1. To get the custom inspector for your subclass, set [CustomEditor(typeof(tk2dSpriteAnimator), true)] in tk2dSpriteAnimatorEditor.cs
2. To stop the sprite from disabling itself, comment out Line 117 in tk2dSpriteAnimator
3. Remove line 137 from tk2dSpriteAnimator to prevent runtime error log
4. To prevent runtime error in editor, change line 259 of tk2dSpriteAnimationClipEditor to preview.Draw(r, Animator.Sprite? Animator.Sprite.GetCurrentSpriteDef() : null);

That's about it. Thanks for the help!

Only one thing remaining as an issue is the packing time... it currently takes close to 30 seconds, to pack 17 1024 textures into 2 atlases, w/ no padding. Any chance this can be expedited?

2
Support / Re: 2d face on a 3d model, possible to use 2DTK?
« on: October 23, 2016, 04:57:03 pm »
Ok cool, I'll try and take a look and see if I can figure it out. We're not looking to use any special features, no rotation, no dicing non of that. Just basic playback control, and looping support, driven from a single 4k texture sheet.

Any more detail you can provide would be excellent, even just the barebones/highlevel approach in pseudocode.
Cheers,

3
Support / 2d face on a 3d model, possible to use 2DTK?
« on: October 22, 2016, 06:30:01 am »
We have a 3d model, with a 2d face (https://i.gyazo.com/4dc7866c83295e8ec15171ddb1b1edb4.png) and would like to drive the facial animations using 2d toolkit. Is this possible? Primarily we want to use the animation tools for building and organizing the different keyframes of each animation, controlling number of loops, etc.

Basically we just want to use a skinned mesh renderer, instead of a tk2dSprite to display each frame of an animation.

4
Support / Re: How To Use Tilemaps to Create Prefabs??
« on: October 30, 2014, 08:50:12 pm »
I'm trying the steps listed here, but for some reason, when I instantiate the prefab, the tiles aren't being rendered.

What I'm trying to, it create small "Bonus Rooms" and them load them into the scene on the fly. When I load a Bonus Room into an existing scene, the Mesh's seem to get nulled out:
http://cl.ly/image/2X2w3T303x0Q

Any ideas that I'm doing wrong?

[UPDATE] I saw your other posts about MeshData not getting saved in prefabs. Calling tileMap.ForceBuild() after instantiation did the trick!

5
Support / Re: Saving and Loading TileMaps
« on: October 17, 2014, 01:42:19 am »
Would it be possible to be a bit more direction on how to  efficiently save and load Tilemaps?

We really want the ability to be able to build a scene and save it to disk as a text file. To be loaded later dynamically. We can serialize our own scene objects easily enough, but still not sure how to go about it with the Tilemaps.
Cheers,

6
Support / Re: Is it possible to access all SpriteCollecitons at runtime?
« on: September 29, 2014, 10:17:45 pm »
Ya should be fine. One of the benefits of doing Pixel Art, all our 8 sprite collections combined fit in a single 1024x2048 texture :)

7
Support / Re: Is it possible to access all SpriteCollecitons at runtime?
« on: September 28, 2014, 08:42:51 pm »
Ok cool, I got it working pretty great by just creating a SpriteCollections script, and linking each SpriteCollectionData prefab by hand.

Works awesome!

8
Support / Is it possible to access all SpriteCollecitons at runtime?
« on: September 28, 2014, 04:52:16 pm »
Is there an API to access all shared SpriteCollections at runtime?

We're trying to implement pallette swapping in our game, using a Shader. Like full 4-color pallette swaps, ala GameBoy Color. So, depending on the Level Loaded, I need to pass some parameters to the material for each spriteCollection.

If I try and set material properties on a specific sprite, the Material gets reverted back to the original, whenever UpdateMaterials() is called in tk2dSprite.

So, what I need to do is access the array of SharedMaterials that tk2d is using, and make my material.SetColor() calls there.

Is there an API to do that? I found ann array of AllCollections them in tk2dSpriteGuiUtility, but it's not accessible in my runtime code. I realize I could probably make a sprite, and change it's sprite collection manually, or link a prefab of each type of sprite, but both of those are pretty hacky.

9
Support / Re: Can't seem to render pixels perfectly...
« on: August 21, 2014, 08:39:21 pm »
Oh I see... It's still not working though.

I had the Dither rendering correctly at 1024x768, and added the Pixel Perfect override.

When I publish the exe, and run at 1080p, it renders like this (zoomed in photoshop)
http://cl.ly/image/1Z2b1q0k1u1K/Image%202014-08-21%20at%201.38.52%20PM.png

10
Support / Re: Can't seem to render pixels perfectly...
« on: August 21, 2014, 08:07:40 pm »
Ya that does fix the issue... but in the real world, the game view will always be scaled, will it not? We need to adjust to devices from 800x400 to 4k monitors, all using Pixel Art...

With PixelPerfect, you can set pixel "zoom level", so we'd simply detect screen size at startup, and assign a zoom level to the camera that will give nice results on that size screen.

With tk2d, I don't see any way to make a dynamic sized camera, that always gives us whole pixels. Overrides seem device specific which is not ideal.


11
Support / Re: Can't seem to render pixels perfectly...
« on: August 21, 2014, 08:01:09 pm »
Ok, so after download PixelPerfect from the asset store, and using it's PerfectPixel camera, we can get exactly what we need.
https://www.assetstore.unity3d.com/en/#!/content/14498



Seems to be related to the formula for doing screen scaling. If it doesn't scale by discrete steps, the pixels will get distorted. When you change zoom level, you get the following values for Orthographic Camera Size:
2 = 1.32
3 = .88
4 = .66
5 = .528
etc...


Is there a way to do this with tk2dCamera?

12
Support / Can't seem to render pixels perfectly...
« on: August 21, 2014, 06:47:26 pm »
We're struggling to make pixel art render correctly....

Here you can see a dither test, in Photoshop, compared to 2dToolkit:


You can see a distinct grid pattern forming on the image due to pixel distortion.

We're using Orthographic camera, with PPM set to 1 on both the camera and the asset. SpriteCollection is set to Point filtering.

No matter what I do, I can't get this Dither to render with perfection :(

13
Support / Re: Moving objects and moving cameras with pixel perfection
« on: August 21, 2014, 06:22:47 pm »
Would it be possible to get an example of doing this in a vertex shader? Would be really handy for us.

14
So we can't even share the TileMapEditorData across multiple scenes? Even if they share the exact same tileMap and settings?

15
I've scoured the docs, but I can't see a good explanation of the role of TileMapData and TileMapEditorData.

Do these need to be unique for each map we edit?

We've started creating multiple scenes that share the same objects, and are seeing strange behavior, like one scene will suddenly populate with the tilemap from another scene. But then fix itself, when re-opened.

Is this a bug? Or should we be creating unique TileMapData  and TileMapEditorData for each tilemap in each scene?

Pages: [1] 2