wojtekpil / Godot-Octahedral-Impostors

Octahedral Impostors implementation for Godot Game Engine
MIT License
268 stars 30 forks source link

Scene imposter of Alicia cause artifacting #11

Closed fire closed 4 years ago

fire commented 4 years ago

image

https://github.com/vrm-c/UniVRM/tree/master/Tests/Models/Alicia_vrm-0.51

GIF 2020-06-29 2-13-30 PM

fire commented 4 years ago

To import you'll need to rename vrm to glb. You'll see some artifacting.

wojtekpil commented 4 years ago

Can you share your settings baking settings? Your impostor will look worse from the top, because its trying to blend between frames which are further apart then side views. There could be also a problem with calculation of virtual plane I don't have a comparison to other bakers. You could probably use something different than octahedral mapping but it's not application for this project. This method is optimized for VRAM usage. I couldn't reproduce your exact problem. Did you change something in shader? For example "Is Full Sphere" checkox ?

fire commented 4 years ago

I don't see anything that makes sense to be broken.

image

wojtekpil commented 4 years ago

Maybe you changed some settings during baking. it would result in unexpected mapping problems. I didn't disable any UI controls, but it should be on my todo list. I tried to bake with this settings (T Pose is really bad for baking): Screenshot from 2020-06-30 00-22-46 It's overkill but results is pretty nice: model_high

fire commented 4 years ago

Are you using the latest 3.2.2 stable? I'm not able to recreate your results?

wojtekpil commented 4 years ago

Yes, it should work on 3.2.2.stable. I also tried it on 3.2.1.stable. Please check this things:

  1. Select baked images in Godot (base.png, norm_depth.png, orm.png) and check on the each of them in the import tab the number of horizontal and vertical slices. It should be equal to the "Grid size" parameter in baker.
  2. Open generated image files by some external program and count images in row and column. It also should be equal to "Grid size"
  3. On a scene tree select baked MeshInstance. Check its properties, go to Mesh -> Material -> Shader Param. Check if "Imposter Frames" is, again, equal to "Grid size" parameter in baker. Also try checking/unchecking "Is Full Sphere"
    Sometimes when I select wrong option here it looks like the problem you have (45 degree angle of models from some views).
  4. Check if "Standard" Shader Type in baker gives you the same results. Working with TextureArrays in Godot is a little bit tricky right now.
  5. You should also play with "Alpha Clamp" and "Is Transparent" parameters in Shader. Those two should be optimized by hand, but I think that your problem is somewhere else.
fire commented 4 years ago

Will close issue because many things have changed in repository and I need to re-evaluate the problem.