Jump to content

[SOLVED] Using Multi/Sub-object material


photo

Recommended Posts

Hello! I ran into a problem, the answer is in the SDK I could not find(( if the engine Supports Multi/Sub-object materials are created in 3Ds maxx? I tried to import the object that is assigned to a Multi/Sub-object material and can not figure out how to assign the materials according to their ID... Or do I need to split this object into several subobjects in order to correctly assign the textures? Do you plan in the near future to release any video tutorials on the SDK or how it is possible to expand the information for Russian-speaking users?


___________________________________________________________________________________________________________


Здравствуйте! Я столкнулся с проблемой, ответ в SDK я не смог найти(( Поддерживает ли движок Multi/Sub-object  материалы созданные в 3Ds maxx? Я попробовал импортировать объект, которому назначен Multi/Sub-object  материал и не могу разобраться как назначить материалы в соответствии с их ID... Или же мне нужно разбить этот объект на несколько подобъектов чтобы корректно назначить текстуры? Планируете ли вы в ближайшее время выпустить какие либо видео уроки по SDK или как то расширить информацию для русскоговорящих пользователей? Спасибо!


Link to comment

Hi Andrey!

 

Sure, Unigine supports Multi/Sub-object materials created in 3ds Max. You should export the mesh into .fbx file and than import to the Unigine engine. The engine automatically split the object to surfaces by materials. Then, in the editor, you should assign the necessary materials to the surfaces.

 

Here is an example to clarify the answer:

1. Create a model in 3ds Max, a multi/sub-object material and assign these materials to the polygons.

post-1513-0-53280300-1448879231_thumb.png

xJE5URy.png

We created 4 materials: red (with the texture), green, blue and yellow. We assign them to the our model. The engine will automatically split the model on surface by the material id.

So we'll get a mesh with 4 surfaces. 
Export the model.

 

2. Open the UnigineEditor.

Let's create a green material before importing the .fbx.

post-1513-0-56567000-1448879772_thumb.png

yDlgV2J.png

 

3. Import the .fbx file, by clicking Import -> FBX File on the Main tab.

You'll see the window with Import options. Disable the Import material option and click Ok.

post-1513-0-65600400-1448879820_thumb.png

wPQ94VK.png

 

Ok, the engine added a mesh with 4 surfaces (according to assigned materials in 3ds Max). But the engine noticed, that the green material has been already created and assign it to the corresponding surface of the mesh. The default mesh_base material was assigned to the all other surfaces.

post-1513-0-22786900-1448879964_thumb.png

cgpMrDs.png

 

Let's import the FBX mesh with the materials:

1. Import the .fbx file, by clicking Import -> FBX File on the Main tab. Again :)

Enable the Import material option and click Ok.

post-1513-0-49091700-1448880041_thumb.png

eeomKXY.png

Save the material in the material folder of the project.

 

The engine added all the necessary materials to the material library by inheriting mesh_base.

post-1513-0-70081600-1448880176_thumb.png

fdly0RJ.png

Also the engine overwrote the already created green material.

post-1513-0-45378600-1448880198_thumb.png

pEvYWhv.png

 

 

That's it!

 

Also, this article on fbx import options can be useful: https://developer.unigine.com/en/docs/2.1.1/tools/editor/import/

 

Thanks,

Best regards,

Andrey

 

__________________________________

 

Привет! Теперь то же самое, только на русском :)

 

Да, движок поддерживает Multi/Sub-object материалы, созданные в 3ds Max. Он разбивает модель на сурфейсы по материалам, т.е. назначено на модель 8 материалов, он сделаем 8 разных сурфейсов. Потом, в добавленной ноде, в табе Surfaces каждому сурфейсу вы назначаете нужный вам материал.

 

Все предельно просто, но есть тонкости, давайте на примере разберемся вместе на примере:

1. Создаем модель в 3ds Max, multi/sub-object материал, назначаем их id на необходимые полигоны (элементы) модели

post-1513-0-53280300-1448879231_thumb.png

Материалы названы: red (с текстурой), green, blue, yellow

При импорте fbx в движок, движок разобъет модель на отдельный сурфейсы (surface) по материалам, т.е. у нас будет их четыре.

Экспортируйте в fbx файл.

 

2. Идем в Unigine editor.

Чтобы наглядно показать зависимость материалов при экспорте, давайте создадим материал, выкрутим ему albedo в зеленый и назовем также, как в 3ds max: green

post-1513-0-56567000-1448879772_thumb.png

 

3. Импортим наш fbx в редактор через Import -> FBX File
Увидим окно с настроечками для импорта. Уберем галочку с import materials, что означает, что мы не будет импортировать материалы.

post-1513-0-65600400-1448879820_thumb.png

 

Наблюдаем добавленный меш. Что мы видим? Что движок добавил объект с 4 сурфейсами, в соответствии с назначенными материалами. При этом, движок увидел, что один из требуемых материалов (а именно green) есть уже в движке и он его назначил. На все остальные сурфейсы он назначил дефолтный mesh_base материал.

post-1513-0-22786900-1448879964_thumb.png

 

Ок. Теперь добавим тот же меш но еще и импортируем материалы:

1. Снова  Import -> FBX File, теперь ставим галочку импортировать материалы и текстуры.

post-1513-0-49091700-1448880041_thumb.png

После нажатия на Ok, нам предложат сохранить материал. Сохраняем.

Смотрим результат в материалах:

post-1513-0-70081600-1448880176_thumb.png

Движок добавил материалы для нашего объекта отнаследовавшись от mesh_base. При этом, он увидел, что green уже есть, и перезаписал его.

post-1513-0-45378600-1448880198_thumb.png

Объект импортирован с материалами!

 

Спасибо, что дублируете вопрос на двух языках, это дает возможность другим участникам форума ответить на ваш вопрос и поможет другим участникам с данной проблемой найти ответ. Да, возможно здесь вы найдете дополнительную информацию по импорту fbx в движок :)  https://developer.unigine.com/en/docs/2.1.1/tools/editor/import/

 

Мы начинаем расширять документацию на русский и китайские языки, в том числе займемся и видео-туториалами. Так что количество статей на русском языке будет увеличиваться :)

 

Спасибо! :)

  • Like 2
Link to comment

Thank you so much, very clear and detailed! I'm just starting to work with this engine. The possibilities are impressive.. I Hope that this wonderful support will be in the future.. look Forward to news from you for our team))

_________________________________________________________________________________________________________________________________________________________________________

Огромное спасибо, очень понятно и подробно! Я только начинаю работать с этим движком. Возможности впечатляют.. Надеюсь, что такая великолепная поддержка будет и в будущем.. Ждем с нетерпением новостей от вас для нашей команды))

Link to comment
  • 3 months later...
×
×
  • Create New...