Search Unity

3dSprites

Discussion in 'Assets and Asset Store' started by chanfort, Dec 16, 2015.

  1. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    3dSprites allows to bring thousands of animated 3D objects into the game. Only up to several hundreds of animated objects can be rendered using meshes in the runtime. So 3dSprites comes here into help. It uses Unity built in Shuriken Particle System to render 3D objects, visible from different angles as sprites. Multiple thousands of sprites can be set onto the scene. To bring more realistic approach, nearby objects are rendered as regular meshes, while more distant ones - as sprites. User can bake any 3D model into 3dSprites.

    Features:
    - optimised rendering pipeline
    - fully animated sprites
    - sprites creation
    - manageable resolutions
    - switchable mesh-sprite modes
    - changeable bilboard distances
    - linking with GameObjects
    - movement examples
    - partial update
    - quality comparison
    - pure C# code, no dll's included

    Demo example can be found online on WebGL and WebPlayer. 3 video tutorials of how to use 3dSprites available on YouTube.




    You are welcome to discuss current 3dSprites features, post your thoughts what you would like to see in future updates or just discuss any question you struggling to work around with 3dSprites!
     
  2. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    @chanfort : hi chanfort, I notice that the Spritesheets & Sprites have semi-transparent. As you can see the image below, it could be fixed easier by Photoshop. But, it can be quite a hard work if I go with "Save Individual Textures [x]", fixed one by one, and lots of individual sprites. Is there a way to set "full transparency" by code?

    Semi-Transparent


    Full-Transparent (fixed by Photoshop)
     
  3. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    Hmm, interesting point. Might be that Unity exports into such semi-transparent format. However, there are multiple things to check. Firstly, if you display in Unity side by side both versions (the original and fixed by Photoshop), how would they compare? By the way, different shaders display textures differently, so you can try the ones, which are used in 3dSprites. I noticed that previously when I was using SpriteManager, these semi transparent artefacts were visible in game, however, since I started to render through particle systems, artefacts disappeared.

    Another thing could be to check how various software understands different formats. It can be affected by any of the following processes:
    - importing in Photoshop
    - fixing and exporting by Photoshop
    - reading with Windows Photo Viewer
    - importing modified Photoshop textures into Unity
    This is why I am trying never to use any other software than Unity itself.

    If textures are really semi-transparent and in Unity the fixing with Photoshop effect would work out, the next step would be to:
    - print out some pixel values which suppose to be transparent after ReadPixels() and GetPixels() but before EncodeToPNG(); if they are semi-transparent here, colour alpha channel values should be above 0.
    - read texture after it was exported and print out what are alpha values at pixels, which suppose to be transparent.
     
  4. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    I can confirm with you. The texture are really semi-transparent at begin. It is not because of opening or editing from different applications. Sprite-Creator scripts is quite long, and not much comments. But, I will try and tell you soon.

    EDIT



    @chanfort : I'm glad I found a way to fix the Semi-Transparent issue without hacking your code base. It turns out when you set the Camera BG to black, you set Alpha=5 somehow. Set Alpha to zero fix the Semi-Transparent problem. The reason that your Particle System does not show semi-transparent I guess it's because of the shader you use. It kind off does not render a pixel with half-opaque.
     
    Last edited: Dec 30, 2015
  5. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    Hmm, very interesting. So does it export now with full transparency if background is corrected?
     
  6. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    Yeah, it fixes if background is corrected. Right now, I'm thinking of an extra Threshold variable for Sprite-Manager. For example, I set if Distance closer than 30, display as Real Models. But, if more than 40 3D-Models are currently being rendered, the 41-th, and so on, even in the close-range still should be rendered as sprites for better performance. What do you think about this approach?
     
  7. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    Doesn't it already using switching to sprites distance of around 20 ?
    Screen Shot 2015-12-31 at 02.04.32.png
     
    ikemen_blueD likes this.
  8. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    hey, I'm glad that I asked you. I just finished Sprite-Creator script, will study next script soon. Happy New Year!!! :)
     
  9. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    3dSprites has just been featured! final.png
     
    Last edited: Jan 3, 2016
  10. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    AssetBundle support has just been added into 3dSprites, so there will be possible to set everything in a way that textures won't affect project built size:


     
    theANMATOR2b likes this.