Page 1 of 1

How to use HLMS PBS ?

Posted: Thu Nov 05, 2015 10:23 pm
by mrmclovin
I'm new to 2.1 so please bare with me.

I'm trying to set up a minimalistic manual mesh, which I have created with VAO. Now I want to assign a hlms material to it. I have registered the HLMS as in Samples/GraphicsManager.

Now, I wanna do for example: item->setItemBlock("Marble") but it says it cannot find it.

So - do I need to define a .material and initialise that with the resourcegroup manager?
hlms Marble pbs
{
..
}
is the above correct way to use it or is that for backcompatibility? I have read the Porting guide but I don't really understand it completely.

Thanks.

Re: How to use HLMS PBS ?

Posted: Thu Nov 05, 2015 11:10 pm
by dark_sylinc
mrmclovin wrote:So - do I need to define a .material and initialise that with the resourcegroup manager?
hlms Marble pbs
{
..
}
is the above correct way to use it or is that for backcompatibility? I have read the Porting guide but I don't really understand it completely.
Yes. A datablock is almost a synonym for a material.
You need to define the Marble material before it can be assigned to an Item or Entity.

Either via script (like the snippet you posted) or via C++ (see PbsMaterialsGameState.cpp for an example of creating the material via code, look for "hlmsPbs->createDatablock" around line 139)