Posible error in path of materials ?
  • I am not sure whether it was the right place for this post.

    I was reviewing the load of objects in EMBER.
    For example, "house3.modeldef", call
    material="/global/items/building_element/rough_timber/timber_roof"
    in various textures and are
    material="/items/building_element/textures/rough_timber/timber_roof"


    Another thing. The name is not correct. Call
    timber_roof
    and in the directory are
    timber_roof[D,N,S].png
    . For example.
    In this case can be defined
    timber_roof
    as a basis or prefix to load all the program find.
    I have not reviewed the entire code. Only the load of an object: HOUSE3.
    I do notice anyway if it is a mistake.
  • The material does not directly refer to a texture file, but instead to a "Material", which are defined in the .material files.
    These can be found here for example: http://amber.worldforge.org/media/media ... s/scripts/
    The specific house material is found in http://amber.worldforge.org/media/media ... s.material
    Many different textures can be used for one surface/material: diffuse, specular, normal etc..
  • Well, I understand.
    Only by doubt. If textures are defined in *. material that the file "house3.modeldef" (I used this as an example) are also defined as part of the object with <subentities>, with path to a picture ?
    Which not only as a property of the object?

    Well, I understand.
    Only for the doubt. If the textures are defined in *.material, why in the file "house3.modeldef" ( uses it of example) also are they defined as a part of the object in <subentities> with route and everything?
    Why not only as a property of the object?

    thanks
  • But the model definitions does not contain any reference to any textures; it only contains references to materials.
    &lt;models&gt;
    &lt;model name=&quot;house3&quot; usescaleof=&quot;depth&quot; scale=&quot;1&#46;100000&quot; showcontained=&quot;true&quot; icon=&quot;&quot;&gt;
    &lt;translate x=&quot;1&#46;000000&quot; y=&quot;0&#46;000000&quot; z=&quot;-1&#46;000000&quot; /&gt;
    &lt;rotation x=&quot;-0&#46;000000&quot; y=&quot;0&#46;707107&quot; z=&quot;0&#46;707107&quot; degrees=&quot;180&#46;000000&quot; /&gt;
    &lt;submodels&gt;
    &lt;submodel mesh=&quot;3d_objects/items/building_element/models/two_room_house/two_room_house&#46;mesh&quot;&gt;
    &lt;parts&gt;
    &lt;part name=&quot;main&quot; show=&quot;true&quot;&gt;
    &lt;subentities&gt;
    &lt;subentity index=&quot;0&quot; material=&quot;/global/items/building_element/rough_timber/timber_roof&quot; /&gt;
    &lt;subentity index=&quot;1&quot; material=&quot;/global/items/building_element/rough_timber/rough_timber_roof_bottom&quot; /&gt;
    &lt;subentity index=&quot;2&quot; material=&quot;/global/items/building_element/rough_stone/floor&quot; /&gt;
    &lt;subentity index=&quot;3&quot; material=&quot;/global/items/building_element/rough_stone/floor&quot; /&gt;
    &lt;subentity index=&quot;4&quot; material=&quot;/global/items/building_element/rough_timber/rough_timber_wall&quot; /&gt;
    &lt;subentity index=&quot;5&quot; material=&quot;/global/items/building_element/rough_timber/rough_timber_beam&quot; /&gt;
    &lt;/subentities&gt;
    &lt;/part&gt;
    &lt;/parts&gt;
    &lt;/submodel&gt;
    &lt;/submodels&gt;
    &lt;actions /&gt;
    &lt;attachpoints /&gt;
    &lt;views /&gt;
    &lt;/model&gt;
    &lt;/models&gt;

    The house3 model is made up of one mesh found in "3d_objects/items/building_element/models/two_room_house/two_room_house.mesh". This mesh in turn is composed of 6 submeshes. The way it works is that each submesh can only have one material, so if you want to have both a wall and a door in the same mesh, but you have two different materials for the wall and door you mush divide your mesh into submeshes.
    So what we say here is that the submesh with index "0" should use the material "/global/items/building_element/rough_timber/timber_roof" and so on.
    The reason we don't specify the textures to use directly and instead use the materials is that we want to be able to reuse the materials for many different meshes, as well as keeping it cleanly separated. Materials can be used for other things too which are not related to Models, for example grass and foliage, water, the sky and so on.
  • Now he is clear. It is good to know it to plan the construction of any object.

    Thank you very much

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID