animate1978 / MB-Lab

MB-Lab is a character creation tool for Blender 4.0 and above, based off ManuelBastioniLAB
Other
1.86k stars 314 forks source link

Eyes in EEVEE are too reflective #23

Closed animate1978 closed 5 years ago

animate1978 commented 5 years ago

screenshot_2019-01-03_23-02-59

Not sure how nor why but the eye shader in EEVEE is far too reflective.

Figured out there is a way to make separate networks for Cycles or EEVEE in the same shader so that is the approach I am going to take I think.

animate1978 commented 5 years ago

I think I figured out the issue and it kind of came to light in Unreal 4 of all places. The cornea material covers the entire eyeball, which it really should only cover the area right around the sclera. This causes the eyes to look reflective in EEVEE and completely opaque in Unreal 4. in the screenshot below you can see where I shaded in Unreal the cornea material, which is black, completely covers the eyeball.

So the plan is to get rid of the mesh that is the cornea unreal_mblab_test

NumesSanguis commented 5 years ago

Talking about the eyes, can we somehow separate that from the mesh? Currently, you can change the value of a Shape Key to change the where the character is looking. However, for game engines this is very unnatural, as you want the eyes to follow some object in the world. I don't know the best way to do this though?

animate1978 commented 5 years ago

Well that did not work. I made a copy of the humanoid.blend file, split the female base model into parts by material, deleted the cornea object, joined the objects into a single object and then saved. Reloaded Blender 2.80 and tried to make a character, promptly got an error message

INFO: Start_the lab session...
INFO: Looking for the retarget data in the folder data...
INFO: Looking for an humanoid object...
INFO: No lab humanoids in the scene
INFO: Appending object MBLab_human_female from humanoid_library.blend
INFO: Object 'MBLab_human_female' imported
INFO: Object 'MBLab_human_female' renamed as 'f_ca01'
INFO: Found the humanoid: f_ca01
INFO: Init the database...
INFO: Looking for the retarget data in the folder data...
INFO: Looking for the retarget data in the folder data...
INFO: Joints data loaded from human_female_joints.json in 0.017000913619995117 secs
INFO: Joints offset data loaded from human_female_joints_offset.json in 0.011000633239746094 secs
INFO: Appending object MBLab_skeleton_base_fk from humanoid_library.blend
INFO: Object 'MBLab_skeleton_base_fk' imported
INFO: Object 'MBLab_skeleton_base_fk' renamed as 'f_ca01_skeleton'
INFO: Importing temporary original skeleton to store z axis
INFO: Appending object MBLab_skeleton_base_fk from humanoid_library.blend
INFO: Object 'MBLab_skeleton_base_fk' imported
INFO: Object 'MBLab_skeleton_base_fk' renamed as 'temp_armature'
DEBUG: Turn the visibility of temp_armature ON
DEBUG: Select and change mode of temp_armature = EDIT
DEBUG: Turn the visibility of temp_armature ON
DEBUG: Select and change mode of temp_armature = OBJECT
INFO: Vertgroups data loaded from human_female_vgroups_base.json in 0.0870048999786377 secs
INFO: Group loaded from human_female_vgroups_base.json
INFO: Looking for the retarget data in the folder data...
INFO: Vertices data loaded from f_ca01_verts.json in 0.06100344657897949 secs
INFO: Morph data loaded from human_female_morphs.json in 1.5330877304077148 secs
INFO: Morph database human_female_morphs.json loaded in 3.369192600250244 secs
INFO: Now local morph data contains 220 elements
INFO: Morph data loaded from f_ca01_morphs.json in 0.3390195369720459 secs
INFO: Morph database f_ca01_morphs.json loaded in 0.830047607421875 secs
INFO: Now local morph data contains 433 elements
INFO: Morph data loaded from human_female_morphs_extra.json in 0.026001691818237305 secs
INFO: Morph database human_female_morphs_extra.json loaded in 0.039002418518066406 secs
INFO: Now local morph data contains 445 elements
INFO: Morph data loaded from f_ca01_exprs.json in 0.2800161838531494 secs
INFO: Morph database f_ca01_exprs.json loaded in 0.4630265235900879 secs
INFO: Now local morph data contains 527 elements
INFO: Bounding box data loaded from human_female_bbox.json in 0.3280186653137207 secs
INFO: Measures data loaded from human_female_measures.json in 0.0009999275207519531 secs
Traceback (most recent call last):
  File "C:\Users\farishta\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MB-Lab\__in
it__.py", line 1693, in execute
    start_lab_session()
  File "C:\Users\farishta\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MB-Lab\__in
it__.py", line 101, in start_lab_session
    mblab_humanoid.init_database(obj,character_identifier,rigging_type)
  File "C:\Users\farishta\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MB-Lab\huma
noid.py", line 216, in init_database
    self.morph_engine = morphengine.MorphingEngine(self.obj_name, self.characters_config[character_i
dentifier])
  File "C:\Users\farishta\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MB-Lab\morp
hengine.py", line 119, in __init__
    self.measures = self.calculate_measures()
  File "C:\Users\farishta\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MB-Lab\morp
hengine.py", line 212, in calculate_measures
    measures[measure_name] = self.calculate_measures(measure_name, vert_coords)
  File "C:\Users\farishta\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MB-Lab\morp
hengine.py", line 209, in calculate_measures
    return algorithms.length_of_strip(vert_coords, indices, axis)
  File "C:\Users\farishta\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\MB-Lab\algo
rithms.py", line 131, in length_of_strip
    v2 = vertices_coords[indices[x+1]]
IndexError: list index out of range

location: <unknown location>:-1

location: <unknown location>:-1

In other words, not sure how to get rid of this cornea issue without causing even more issues.

animate1978 commented 5 years ago

Did a minor "fix" to the shader. Now there are two separate outputs, one for Cycles and one for EEVEE. A transparent shader is attached to the EEVEE output. It will default to blending mode of Multiply, initially this was forgotten and was still set to Opaque but did a quick fix and new commit.

animate1978 commented 5 years ago

I guess this "bug" is "fixed" now. Closing the issue.

animate1978 commented 5 years ago

Talking about the eyes, can we somehow separate that from the mesh? Currently, you can change the value of a Shape Key to change the where the character is looking. However, for game engines this is very unnatural, as you want the eyes to follow some object in the world. I don't know the best way to do this though?

Yeah same here, just separating the eyes, deleting some polygons caused a serious problem, I think it has to do with the vertices count and the JSON library of morph data and probably more data I am sure I am not fully understanding at this point.

Trying to reverse engineer and update code and other assets at the same time, not easy