Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssimpImporter: support PBR #91

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

mosra
Copy link
Owner

@mosra mosra commented Aug 16, 2020

Postponed from mosra/magnum#459, custom material attribute support offloaded to #116.

List of nightmares to wake up from, most of them hopefully obsoleted with the allegedly better PBR support in 5.1:

Current output from magnum-sceneconverter for an overview of how bad things are:

$ magnum-sceneconverter --info WaterBottle.gltf 
Material 0 (referenced by 1 objects): BottleMat
  $mat.gltf.pbrSpecularGlossiness @ Trade::MaterialAttributeType::String: 
  $mat.twosided @ Trade::MaterialAttributeType::String: 
  $tex.file.LIGHTMAP @ Trade::MaterialAttributeType::String: WaterBottle_occlusion.png
  $tex.file.UNKNOWN @ Trade::MaterialAttributeType::String: !WaterBottle_roughnessMetallic.png
  $tex.file.texCoord.DIFFUSE @ Trade::MaterialAttributeType::String: 
  $tex.file.texCoord.EMISSIVE @ Trade::MaterialAttributeType::String: 
  $tex.file.texCoord.LIGHTMAP @ Trade::MaterialAttributeType::String: 
  $tex.file.texCoord.NORMALS @ Trade::MaterialAttributeType::String: 
  $tex.file.texCoord.SPECULAR @ Trade::MaterialAttributeType::String: 
  $tex.file.texCoord.UNKNOWN @ Trade::MaterialAttributeType::String: 
  $tex.strength.LIGHTMAP @ Trade::MaterialAttributeType::Float: 1
  AlphaBlend @ Trade::MaterialAttributeType::Bool: false
  AlphaMask @ Trade::MaterialAttributeType::Float: 0.5
  BaseColor @ Trade::MaterialAttributeType::Vector4: Vector(1, 1, 1, 1)
  DiffuseColor @ Trade::MaterialAttributeType::Vector4: Vector(1, 1, 1, 1)
  DiffuseTexture @ Trade::MaterialAttributeType::UnsignedInt: 0
  EmissiveColor @ Trade::MaterialAttributeType::Vector3: Vector(1, 1, 1)
  EmissiveTexture @ Trade::MaterialAttributeType::UnsignedInt: 5
  Glossiness @ Trade::MaterialAttributeType::Float: 1
  Metalness @ Trade::MaterialAttributeType::Float: 1
  NormalTexture @ Trade::MaterialAttributeType::UnsignedInt: 3
  NormalTextureScale @ Trade::MaterialAttributeType::Float: 1
  Roughness @ Trade::MaterialAttributeType::Float: 1
  Shininess @ Trade::MaterialAttributeType::Float: 1000
  SpecularColor @ Trade::MaterialAttributeType::Vector4: Vector(1, 1, 1, 1)
  SpecularTexture @ Trade::MaterialAttributeType::UnsignedInt: 6
  Layer 1:
    $tex.file.texCoord.DIFFUSE @ Trade::MaterialAttributeType::String: 
    DiffuseTexture @ Trade::MaterialAttributeType::UnsignedInt: 1

@mosra mosra added this to the 2020.0b milestone Jun 19, 2021
@mosra mosra mentioned this pull request Jun 19, 2021
4 tasks
@mosra mosra mentioned this pull request Oct 3, 2021
pezcode added a commit to pezcode/magnum-plugins that referenced this pull request Nov 24, 2021
Largely taken from mosra#91

Anything unrecognized is imported with the raw Assimp name and type. Can be turned off with ignoreUnrecognizedMaterialData, or overridden to import everything raw with forceRawMaterialData. The latter implies ignoreUnrecognizedMaterialData=false.

For existing material tests we use ignoreUnrecognizedMaterialData, otherwise they'll break with every new Assimp version.

TODO: tests, docs
@mosra mosra changed the title AssimpImporter: support PBR and custom attribs. AssimpImporter: support PBR Nov 28, 2021
@mosra mosra removed this from the 2021.0a milestone Nov 28, 2021
@mosra mosra mentioned this pull request Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant