Voxelers / 3d

3D in Voxelers
Apache License 2.0
9 stars 1 forks source link

Modify the model with new materials and textures #47

Closed acs closed 2 years ago

acs commented 2 years ago

Could it be done done in Godot or we need to do it in Blender where the original model was created?

A texture is an image or pattern only, whereas a material is a collection of information that defines an object’s color, shininess, transparency, and bumpiness. (https://all3dp.com/2/blender-how-to-add-a-texture/)

acs commented 2 years ago

We have the 3D models from Blender in:

12:39 $ du -sh 3d_models/*
864K    3d_models/mob.blend
932K    3d_models/player.blend

and they have been exported to GLB format from Blender also:

12:39 $ du -sh dodge_the_creeps_3d/art/player.glb*
52K dodge_the_creeps_3d/art/player.glb
32K dodge_the_creeps_3d/art/player.glb.import

It is the models in glTF format:

« glTF (derivative short form of Graphics Language Transmission Format or GL Transmission Format)

So it is a transmission format, so maybe, the models could be modified after its loading because the contain all the information (models, textures) to do it.

But after a quick look in Godot, it see the model as a 3D mesh with colors and materials and textures inside the mesh. So not sure it can be modified.

Hmmm, now I have doubts. Take a look to:

Screenshot from 2022-05-14 12-47-28

The 3 materials of the player models appear! So maybe we can play with them.

Screenshot from 2022-05-14 12-48-57

Screenshot from 2022-05-14 12-50-45

So it is clear that we can change the material and the textures of the models.

What we can not do it to edit the model. This is Blender territory!

acs commented 2 years ago

In order to play with materials in Godot there is a cool demo that can be loaded in Godot to play with: https://godotengine.org/asset-library/asset/123 Screenshot from 2022-05-14 13-08-19 Screenshot from 2022-05-14 13-09-48 Screenshot from 2022-05-14 13-10-54

acs commented 2 years ago

So as a conclusion, we can modify the material and textures in Godot, which is great because probably, we can change them during the game.

But I am pretty sure that in Blender we should do the initial creation of materials with their textures.

And it is time to explore one of the projects that I want to look at in the past months: https://www.materialmaker.org/

« Material Maker is a procedural PBR (Physically Based Rendering) materials authoring tool, based on the Godot Engine.

Materials are defined as graphs where nodes create or transform textures, and can be exported for the Godot, Unity and Unreal game engines.

There are more than 200 available nodes, and new nodes can be created either by connecting and grouping existing nodes, or by describing them in GLSL.

As a procedural procedural material authoring tool, it can be used to describe the textures that define a material by interconnecting basic nodes that generate, transform, filter or combine their input textures in a graph. »

Materials are defined as graphs where nodes create or transform textures

https://rodzill4.github.io/material-maker/doc/intro.html

So you have textures to work with and inside material maker you can transform them. And the nodes are implemented using GLSL (OpenGL Shading Language) the principal shading language for OpenGL, which I have used already in the past in MagicaVoxrels. So, really cool!

Let's take a look to the tutorial at: https://www.youtube.com/watch?v=mSuyrsJSZ_o

I am not sure if the materials created can be also used in Blender. I am pretty sure that yes. But after a quick look, it seems that they are competing in the are of procedural material generation.

Blender and Material Maker seems to be the Open Source solutions, and Adobe Substance Designer the closed one. Nice discussions in Blender forums

And yes, you can use the PBR textures generated by Material Maker with Blender: https://www.reddit.com/r/blender/comments/g3vshv/theres_this_open_source_alternative_to_substance/

Other interesting project for generating textures:https://github.com/njbrown/texturelab

acs commented 2 years ago

I should read more about PBR other intro but I am not sure it is the alternative to follow to work with textures. To generate textures, it seems to be the reference. But, do we need to generate textures? Or just reuse already created ones?

acs commented 2 years ago

Blender has a great collection of textures: https://cloud.blender.org/p/textures/

acs commented 2 years ago

Ok, done a quick test with Godot:

Screenshot from 2022-05-14 17-03-02

Our new ship has a military green color with a texture that is a kind of camouflage. Good enough for this try.

acs commented 2 years ago

I will stop investing time in this issue now, but for sure I will continue researching in materials and textures, now with a more solid knowledge base.

acs commented 2 years ago

Screenshot from 2022-05-14 17-19-02

acs commented 2 years ago

Interesting PBR intro: https://cgcookie.com/lessons/pbr-introduction

«Physically based is the new standard for creating materials. Instead of relying on diffuse and specular components separately, PBR shaders work with roughness and real reflections. To create most any opaque material, you'll just need to adjust four settings:

Roughness
Fresnel
Metalness
Displacement

»