Try   HackMD

Shaderverse from scratch - how to generate 3D NFTs in Blender

Yo yo I'm Aidan I create augmented reality games and run AR House and I'm currently building a zelda-like RPG that adds sidequests to your real life ⚔️🛡

I was curious to make generative swords for my players and luckily my favorite 3D tool Blender received a very special add-on just for this.. Shaderverse! 🎨

Here's the result of that experiment:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Now I'm going to teach you how it was done 👩‍🎨

Download Blender 3.1+

Shaderverse requires a new Blender feature called Geometry Nodes so you'll need the latest version

https://www.blender.org/download

Download Shaderverse

Shaderverse is open-source and available via GitHub. Download the ZIP but don't unpack it, Blender will import the ZIP

https://github.com/shaderverse/shaderverse

Importing Shaderverse into Blender

  1. Import the zip file into Blender
    Edit > Preferences > Add-ons > Install

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. Select the Shaderverse ZIP, most likely in your Downloads folder and hit Install Add-on

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. Make sure in the Add-ons panel Shaderverse is installed and the checkbox is toggled to ✅

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. You'll now see a Shaderverse tab on the sidebar of the 3D View

If you don't see the sidebar, press the N key

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

If Shaderverse is visible in the sidebar, congratulations you've just learned how to install Blender Add-ons 👏👏👏

Preparing models for generation

If you feel tempted to hit the Generate NFT button you'll surely see an error. That's because we haven't set up our 3D assets yet!

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

To get started we'll add some basic Blender shapes. Imagine these shapes are the variety of face shapes of say a Bored Ape NFT.

Go to 3D View > Add > Sphere

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Go to 3D View > Add > Cone

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Hit the Wireframe view button to see all the objects you just added

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Setting up NFT attributes

Now we'll figure out how to make our NFT decide to be a Box, Cone, or Sphere so first we must set up our attribute "Shape"

  1. Create a new collection and call it Attributes
    Outliner > Right Click > New Collection
    Double Click Collection > Change name to Attributes

Collections are basically just groups or folders. You can store objects in your scene in them. Shaderverse uses them to organize the 3D objects that will go into our NFTs

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. Create another collection and call it Shape
  2. Make sure the Shape collection is within the Attributes collection
  3. Drag your Cube, Sphere, and Cone objects into your new Shape collection

It should look like this when you're done! A Box, Cone, and Sphere within a Shape collection within an Attributes collection

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Here's a GIF of the whole process

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Now your objects are ready for Shaderverse! Again, think of these basic shapes as the headshape of your generative Bored Ape NFT 🐵

Setting up the NFT object

When we generate the NFT, the data from our Attribute collections will be applied to an arbitrary object. We need to create those objects first to receive our attributes. Really just adding a couple of cubes with the right names

  1. Add a cube (3D View > Add > Cube)
  2. Name the cube MainNode
  3. Add a cube (3D View > Add > Cube)
  4. Name the cube Shape
  5. In the shaderverse panel, select the eyedropper next to Main Geometry and select the MainNode Cube we just created

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Setting up the geometry nodes

The geometry node is what enables the random generation of our NFT. In this simple case, it will decide whether our NFT 'Shape' is a Box, Cone, or Sphere

  1. Go to the top bar and select Geometry Nodes. You'll see the entire Blender UI change and a new window called Geometry Node Editor will become available at the bottom

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. select the MainNode object we just created
  2. In the Geometry Node Editor, hit New

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. In the Geometry node sidebar, hit Group

If you don't see the sidebar, press the N key

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. In the Inputs panel, press [+] to add an input, name it Shape (to match the Collection we just made) and switch Type to Object

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. Drag away the connection to remove the connection between Group Input and Group Output

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

It should look like this when you're done

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

..Now we'll repeat a similar process for Shape..

  1. select the Shape object we just created
  2. In the Geometry Node editor window, hit New

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. In the Inputs panel, press [+] to add an input, name it Shape (to match the Attribute collection) and switch Type to Object

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. Now we need to add a new node called Object Info
    Add > Input > Object Info

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. Drag the Object Info node between our existing nodes and click to confirm. You'll see the Group output will automatically connect to the Object Info node

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  1. Connect the Shape input we created to the Object input in the Object Info node
  2. Switch from Original to Relative

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

IT'S READY!!! 🎉

Hide the attributes collection by clicking the 👁 icon. The 3D scene view should now look empty

✨🧨Hit that Generate NFT button! 🙏🛠 Instead of an error you should see an object appear in the 3D scene view and the Shape attribute metadata update to reflect the current shape. Hit it a few times to see it toggle between a Box, Cone, or Sphere

What now?

You can see my sword generator is just more of the same of what you just learned. I have all my generative attributes (blade, handle, etc.) broken into Attributes and for each attribute there's a Collection of models, a Geometry Node, and an object to receive the attribute

You can create as many attributes as you'd like so imagine for an avatar you can repeat this process to choose a random face shape, eye color, hair type, or accessory. Each of these qualities is just another attribute and a collection of 3D objects

You can also decide how rare a specific attribute is by changing the rarity setting! This applies to an attribute in general (Headware) as well as the individual model (Crown)

SHOW OFF! 🎉

If you create something with shaderverse send a link to @aidan_wolf and I'll post it right here:

[Your shaderverse project here]
[Your shaderverse project here]
[Your shaderverse project here]

Hopefully this tutorial was helpful to get you started with generative 3D NFTs!! 💡🙇‍♂️✨