cryptovoxels / issues

🐞 Bugs and issues to be resolved on cryptovoxels
5 stars 1 forks source link

[Feature request] Option to set texture for NFTs as emissiveTexture #90

Open EibrielInv opened 4 years ago

EibrielInv commented 4 years ago

Selección_999(455)

The color of the NFT in the right looks greyed out, making cryptoart look very different from the original.

I've trying to recreate the issue on Babylon.js Playground, but I can't achieve exactly the same desaturated look.

After reading #5 I'm assuming that the greyed look is a side effect of trying to make one-fits-all-NFTs material. Maybe could be good to add more controls (besides "Inverted") allowing the user to set up the material.

For example a control to set material.alpha = 1, set material.alphaMode = BABYLON.Engine.ALPHA_PREMULTIPLIED, and to set texture.hasAlpha = true.

In the mean time, is it possible to access material and texture properties from the Scripting section of the NFT?

EDIT: I've updated the Babylon Playground test to match the version used on Cryptovoxels (3)

EibrielInv commented 4 years ago

Cryptovoxels is full of mysteries :smile:

This NFT I found looks way better than most! https://www.cryptovoxels.com/play?coords=E@121E,326S Selección_999(456)

Compared with the original image: Selección_999(458)

Compared now to me adding the NFT again as NFT (left) and as image (right): Selección_999(457)

I'm assuming that the NFT texture and the material is created when the NFT is placed, and probably the code was different in the past.

EibrielInv commented 4 years ago

Mystery solved. The images look best when they face West (or Up).

I assumed that the images where applied as follows:

material.emissiveTexture = texture
material.diffuseColor.set(0, 0, 0)

But according to https://github.com/cryptovoxels/issues/issues/5#issuecomment-490328470 it is:

material.diffuseTexture = texture
material.emissiveColor.set(1, 1, 1)

That means that the texture is affected by the ambient illumination, specular color and so on.

So, in short, my feature request is to add a property on the NFT to set the texture as emissiveTexture.

ghost commented 4 years ago

@bnolan Any ideas on this one?