webaverse / app

Web metaverse client
https://app.webaverse.com
MIT License
344 stars 207 forks source link

Generate avatar previews #1371

Closed madjin closed 2 years ago

madjin commented 3 years ago

Cryptopunks have a good avatar pose that signals membership:

image

We already generate VRM previews, and we can apply poses to them. Therefore it shouldn't be hard to generate a new endpoint that will give cryptopunk-style previews.

On top of posing the avatar correctly (looking to the side), we should generate a shader plane for the background of this screenshot, keyed by the "id" (NFT token id, or URL), and then put through a hash function (like alea, which we use) to select the generation offset (seed) for the shader to use.

Here is the raw shader:

https://www.shadertoy.com/view/ftsSR2

And here are some of the symbols it renders so it is clearer how it works:

image

https://svgshare.com/s/Z6p

avaer commented 3 years ago

Here are some ways it can look like (but the pose should be looking more like the punks):

image image

avaer commented 3 years ago

This is what the rendering pipeline looks for the preview server (it should be possible to host locally and point the hosts file):

https://github.com/webaverse/preview-backend/blob/master/routes/preview.js#L206 https://github.com/webaverse/app/blob/c20c96e83efb18af2aaa8ebd1b8dd589da809c0d/preview.js#L291

madjin commented 3 years ago

To better understand the pose / angle of the headshot here's a couple other avatar projects for inspiration that are higher resolution than punks. image image

Made a couple headshot poses to get an understanding, its also better when the eyes don't always face towards you image

Vianvolaeus commented 3 years ago

The bottom headshots are great. I think we should avoid both direct camera facing as mentioned and any kind of default rigging pose eg: t-pose / a-pose.

I think it's worth trying to generate a preview that's good enough that you'd want to use it on social media as a profile picture. That is a layer of identity transfer for digital characters / avatars that's very well documented as being desirable.

Note: VRoid Hub (or Studio?) forces you to provide a headshot and bodyshot before you can fully publish a character, and has a little camera suite to do so. I think there's lessons to be learnt there in terms of avatar display (and potentially a marketplace), some of which we've implemented to a degree already in the FE (non-static previews, posing)

Vianvolaeus commented 3 years ago

image

VRoid Studio's has gradually become quite feature rich over time, with custom poses, preset animations, facial posing etc, and is generally quite user friendly and fun to use. It won't let you upload to Hub until you take these photos.

Vianvolaeus commented 3 years ago

Characters react with an animation when you press like on them! This is a pretty nice feature. image

avaer commented 3 years ago

I think there's lessons to be learnt there in terms of avatar display (and potentially a marketplace), some of which we've implemented to a degree already in the FE (non-static previews, posing)

Though that would be a different feature from the socials avatar mode. Part of this feature is that it is standardized, and you are not choosing it, you are only choosing the avatar.

Nothing is preventing an actual photo booth from existing, but the output of that would serve a different purpose, not necessarily linking avatars together using social media.

Vianvolaeus commented 3 years ago

Bringing in some previews from @avaer that were posted in the discord.

I think the first is great, as evidenced by the pure black hair on top of it, it looks like it works fine even with very dark colors on top of it.

image image

avaer commented 3 years ago

Toon shader:

image

avaer commented 3 years ago

I will also try my "challenger" outline + background gradients.