首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有办法从AssImp中检索所有材质属性?

有没有办法从AssImp中检索所有材质属性?
EN

Stack Overflow用户
提问于 2016-09-18 05:42:18
回答 1查看 1K关注 0票数 0

将材质导入到AssImp中时,属性会减少到一个较小的子集(漫反射、发射等)。有没有办法访问不属于该子集的材质属性?例如,在下面的示例中,我可以获得refl_samples吗?

例如:

FBX文件中的此材质

代码语言:javascript
复制
Material: 1821000800, "Material::MRTest", "" {
    Version: 102
    ShadingModel: "unknown"
    MultiLayer: 0
    Properties70:  {
        P: "ShadingModel", "KString", "", "", "unknown"
        P: "AmbientColor", "ColorRGB", "Color", "",0.847058892250061,0.501960813999176,0.898039281368256
        P: "DiffuseColor", "ColorRGB", "Color", "",0.847058892250061,0.501960813999176,0.898039281368256
        P: "SpecularColor", "ColorRGB", "Color", "",0.600000023841858,0.600000023841858,0.600000023841858
        P: "SpecularFactor", "double", "Number", "",2
        P: "ShininessExponent", "double", "Number", "",1024
        P: "TransparencyFactor", "double", "Number", "",0
        P: "EmissiveColor", "ColorRGB", "Color", "",0,0,0
        P: "EmissiveFactor", "double", "Number", "",0
        P: "3dsMax", "Compound", "", ""
        P: "3dsMax|ClassIDa", "int", "Integer", "",1890604853
        P: "3dsMax|ClassIDb", "int", "Integer", "",1242969684
        P: "3dsMax|SuperClassID", "int", "Integer", "",3072
        P: "3dsMax|Parameters", "Compound", "", ""
        P: "3dsMax|Parameters|diff_color", "ColorAndAlpha", "", "A",0.847058892250061,0.501960813999176,0.898039281368256,1
        P: "3dsMax|Parameters|diff_rough", "Float", "", "A",0
        P: "3dsMax|Parameters|diff_weight", "Float", "", "A",1
        P: "3dsMax|Parameters|refl_color", "ColorAndAlpha", "", "A",1,1,1,1
        P: "3dsMax|Parameters|refl_gloss", "Float", "", "A",1
        P: "3dsMax|Parameters|refl_samples", "Integer", "", "A",8
.
.
.

将被简化为:

代码语言:javascript
复制
<MatPropertyList  num="12">
    <MatProperty key="?mat.name" 
    type="string" tex_usage="n/a" tex_index="0">
        "GreenTeapot"
    </MatProperty>
    <MatProperty key="$clr.diffuse" 
    type="float" tex_usage="n/a" tex_index="0" size="3">
        0.133333 0.796079 0.172549 
    </MatProperty>
    <MatProperty key="$clr.emissive" 
    type="float" tex_usage="n/a" tex_index="0" size="3">
        0.000000 0.000000 0.000000 
    </MatProperty>
    <MatProperty key="$clr.ambient" 
    type="float" tex_usage="n/a" tex_index="0" size="3">
        0.133333 0.796079 0.172549 
    </MatProperty>
    <MatProperty key="$clr.specular" 
    type="float" tex_usage="n/a" tex_index="0" size="3">
        0.000000 0.000000 0.000000 
    </MatProperty>
    <MatProperty key="$mat.opacity" 
    type="float" tex_usage="n/a" tex_index="0" size="1">
        1.000000 
    </MatProperty>
    <MatProperty key="$mat.reflectivity" 
    type="float" tex_usage="n/a" tex_index="0" size="1">
        0.000000 
    </MatProperty>
    <MatProperty key="$mat.shinpercent" 
    type="float" tex_usage="n/a" tex_index="0" size="1">
        2.000000 
    </MatProperty>
    <MatProperty key="$mat.shininess" 
    type="float" tex_usage="n/a" tex_index="0" size="1">
        2.000000 
    </MatProperty>
EN

回答 1

Stack Overflow用户

发布于 2016-09-19 11:56:03

后处理方法可能会删除这些属性。尝试在您的标志中不使用aiProcess_RemoveRedundantMaterials。如果您想删除其他材料而只保留少量材料,则可以使用AI_CONFIG_PP_RRM_EXCLUDE_LIST对其进行配置

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39552022

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档