Godot doesn't import glTF material shaders correctly - blender

I have a model that I am using as my gameworld in Godot and I am putting some textures on it in Blender. When exporting the model to .glb it seems to not be exporting some of the materials correctly.
The ones that are an image texture that I scaled using mapping.
It just skips the first two nodes. When I disconnect them the material looks like it does in Godot.
What it should look like (what it looks like in Blender):
What it looks like in Godot:
There also are some materials that use mix shaders to mix images together. These are also skipped and it just uses one of the two instead of mixing them.
What it should look like:
What it looks like in Godot:
The F is from an image with text that is overlayed ontop of the other image.
I am not really sure if these issues lie with the glTF format and certain shaders just don't work with it or that Godot doesn't want to import them.
I hope someone can help me with this.
Thanks in advance and have a nice day,
Rover

In general, arbitrary node graphs cannot be exported from Blender — see https://blender.stackexchange.com/a/57541/43930 for the long explanation of that. To ensure that the material will export correctly, you'll need to refer to the documentation for the Blender glTF exporter and configure your material accordingly. For more complicated effects, you can also bake Blender nodes down to simpler textures.

Related

Assimp FBX loader and PBR textures

I would like to know if the assimp FBX loader does supports PBR materials.
I am currently using it with glTF/glb files and it perfectly loads my PBR textures.
I am loading PBR textures via the "assimp/pbrmaterial.h" header file, but this file is only defining glTF macros.
How can I load PBR textures when using the FBX file format with assimp ?
Regards.
I don't think it can. glTF 2.0 uses a single texture that contains: metallic on the blue channel, roughness on the green. And from my own testing using Blender v2.93.3 (the latest right now), if you use its Shader Editor to split that single texture into separate RGB channels, the FBX won't get saved with any paths to it. Even when you import the FBX back into Blender it will only have the base color and normal map applied, nothing else. So I don't think you can expect Assimp (v5.0.1) to work with it either... But this might just be a bug in Blender, I'm not sure. Because it seems that if metallic and roughness are individual textures, Blender can correctly import the FBX back. It's a pretty big oversight that you can't export (as FBX) models that use multi-channel textures. Pretty much all PBR workflows involve having them merged into a single texture, to reduce texture lookups.
I don't know... seems like glTF 2.0 is a much better format. It comes with a GPU-friendly binary (compared to something like Wavefront OBJ which is very slow), and you can even have the textures separately if you choose the "glTF Separate" format when you export it. You automatically get a merged PNG with both metallic and roughness like I said before:
If you really wanna have support for FBX files (I know I do; it's a popular format), what you could do, is to have it correctly identify and load the base color and normal map, but then you have to manually load the "PBR" texture somewhere before the render loop starts, and then manually bind the texture and send it as a uniform to the fragment shader before drawing it. I tested this and it works.
glActiveTexture(GL_TEXTURE2); // Texture unit 2
glBindTexture(GL_TEXTURE_2D, *pMyMetRoughTexture);
pShader->SetInt("uMaterial.MetallicRoughnessTexture", 2); // Tell the sampler2D from the fragment shader to use texture unit 2
pMyModel->Draw(pShader);
But having 2/3 textures loaded automatically and 1 left up to you, to manually handle, for every... single... model... is just... bleh. I'm sorry if this isn't a "proper" answer. I'm really disappointed by the lack of PBR support, for something that's used so ubiquitously in I think all AAA games in the last few years.

GLTF and USDZ repeat and scale texture problem (tiling texture)

We're trying to do tiling textures for AR Quick Look (iOS in USDZ (pixar) format), but issuing a problem.
What we have:
Project in the blender, where we use scaling texture via mapping (screen below) and everything looks fine like it is tiled properly.
When I do export in GLTF 2.0 you can see, that texture is not scaled (scale should be 100, 100) and that is why it looks bad. Doing not tiled textures for (for example) roads, is bad idea, so, that is why i'm using it.
The same goes to usdz.But i think that it is because of GLTF format
Not sure if while exporting from blender to gltf i should do something correctly
This question might be better suited for Blender SE, not here.
The glTF exporter is looking for a shader node called "UV Map" instead of that "Texture Coordinate" node you have there. I realize the names are almost synonymous, but the "UV Map" node has a chooser for which UV Map, and that's what the exporter wants to find. (For more detail, there is documentation.)
Also I don't know if glTF export supports that little splitter node you have in your graph there. Try drawing individual lines from the "mapping" box to each of the image textures.

Blender: How to correctly export gltf/glb with armature applied

I am having a persistent issue when exporting glb and gltf models from blender (2.79) that have armature applied.
I am using this exporter.
Exporting the model with an armature NOT applied gives me the expected result (ie it appears as it does in Blender) but as soon as I apply an armature (before I have even added any animation) the model exports with all the shapes rotated.
There is at least some consistency to the problem in that it appears as though all the shapes are rotated through 90 degrees on the X axis (although some are positive and some are negative).
To compare I have exported a glb with no armature, a glb with armature, and an obj with armature just to check that there is no issue with my original file. (I have done the same with gltf just in case. You can see a screenshot of that comparison below brought into a-frame.
Here is a side view for ease of comparison. You can see how the individual shapes are flipped 90 on the x axis.
Here as well is a link to that aframe scene
And here is a link to a zip of the blender file
I have looked at many similar issues that suggest applying all rotation/scale etc. tidying up the model etc. I have done all that and tidied up my model as much as I know how. It seems as though the model and armature is ok as the obj export works fine.
I have seen similar questions such as this one but they are mostly to do with distortion of models once animated. I have worked backwards to understand the root of the problem and it does seem that simply applying the armature is what explodes the model in this way.
Am I doing something wrong? Is there an export setting I am missing?
Any help greatly appreciated as ever. And if any more info is needed, please let me know.

How to transform object from Cycles Render to Blender Render

I have blender file which loads the scene fine in Cycles Render.
However, I need it to correctly load the textures in Blender Render.
Any hints how I can achieve that?
Thanks!
For simple materials it can be easier to re-create the same look using blender internal material settings. For more complex materials the best you can do is bake the cycles material to an image that you can then use in blender internal.
If you have trouble with baking you may want to ask at blender.stackexchange which offers blender specific help.

Is it possible to animate markers in ArcMap?

I'm completely new to ArcGIS and ArcMap, but someone suggested this program to me for a project I'm working on.
I would like to animate individual entities on a map, and was wondering if it is possible to do so in ArcMap. I asked this earlier here and a member directed me to a tutorial on animating in ArcGIS. The animation in the guide was over a map spread (ie. each pixel on the map displays, say, a different color to indicate population data in the area). However I realized that if I zoom in a lot, eventually the image will degenerate into pixels, which is why I need an actual object to mark a certain point. I checked some online tutorials and it seems like we can place markers on the map. Can someone tell me if it is possible to animate these markers (for example via a for-loop)? And if so, could you point me in a direction where to start?
Thanks in advance!
You can animate layers in ArcMap is the short answer. Its not as simple as using the timeline feature in Google Earth for example though. But then ArcMap is much more than just a visualization tool.
This help page on the ESRI web help looks like a good place to start.
I'm not 100% sure what you mean by the image degenerates into pixels. Are you saying that the markers were single points in the layer. Unlike Google Earth you are not confined to simply plotting points on the map. You can draw completely arbitrary shapes in ArcMap, which can be defined to cover actual areas of the map, so when you zoom-in the shape gets larger.
The way you need to load data into ArcMap to produce an animation isn't too simple. There might be other ways to do this, but the way I know of is to generate a NetCDF file. This file contains a 3D matrix of layer data, where each layer is separated through time. Because you generate a matrix, you are effectively placing a raster image over the map. Thus if you want to cover a large area, each matrix becomes large, and you multiply that by the number of time slices you wish to animate over.
Once you have a NetCDF file with your data in however, getting ArcMap to animate it and produce say a .avi file is pretty simple.
You could try just loading some of the example NetCDF datasets into ArcMap to see how/if they will work to get you started.
Hope that helps.
The upcoming v10 will have better time-aware capabilities, which will allow for animation.