Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

8
A process (and .unitypackage) to convert sprites to meshes
Post Body

TL;DR - I wrote an article with a .unitypackage and details about converting Sprites to Meshes so that they can be used with things like realtime shadows. You can read it here.


When Unity 5 was released I was very excited to get my hands on real time lighting, post processing, and all the other awesome things it provided.

Unfortunately some of those things didn't seem available for 2D features by default, such as shadows being cast by and received by sprites.

After trying a bunch of tricks and shaders that other people had suggested for 4.x and 5, none of which seemed to work for me, I took one of the more stable concepts I had come across and wrote a couple small scripts to fit it that process into my workflow.

I've written an article - you can read it at my site - which goes over the basics.

Essentially the tool takes all the Sprite mesh info it can, generates (and saves) meshes, and updates the Sprite game object to use Mesh rendering instead.

After conversion the used-to-be-sprite is pretty much immediately ready for real time lighting: http://gfycat.com/ApprehensiveShabbyBongo

There are some shortcomings, such as not working with Sprite animations (flipbook), but for static sprites such as tiled backgrounds and environments, this should do quite well.

Hopefully this is helpful!

Let me know if you have any feedback or other thoughts. I'm contemplating writing a post about setting up a 2D scene with more interesting shadows and lighting as an extension of what this post sets up, if this post has been interesting enough?

Author
Account Strength
90%
Account Age
14 years
Verified Email
Yes
Verified Flair
No
Total Karma
3,533
Link Karma
506
Comment Karma
2,869
Profile updated: 3 days ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
9 years ago