How to use HLMS PBS ?

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
mrmclovin
Gnome
Posts: 308
Joined: Sun May 11, 2008 9:27 pm
x 12

How to use HLMS PBS ?

Post 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.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4211
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 802
Contact:

Re: How to use HLMS PBS ?

Post 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)

Post Reply