About Store Forum Documentation Contact



Post Reply 
drawOverlay having no effect [resolved]
Author Message
JonathonA Offline
Member

Post: #1
drawOverlay having no effect [resolved]
Hello everyone; having some trouble using drawOverlay(...).

During the character creation steps of my game I wish to apply tattoos/markings based on user-input. Here is the code as it looks now:

Code:
void RenderAvatar()
{
    switch(Renderer())
    {
        case RM_PREPARE:
        {
            // Code removed for brevity
            if(mesh)
            {
                Matrix& mat = Matrix(MatrixIdentity);
                mesh->draw(mat);
            }
            // Code removed for brevity            
            break;
        }

        case RM_OVERLAY:
        {
            // Code removed for brevity

            if(tattoo && definition.breed == BREED_HUMAN)
            {
                MeshLod &lod = mesh->getDrawLod(MatrixIdentity);
                REPA(lod)
                {
                    if(Str(lod.parts[i].name) == "Human_Male_Torso")
                    {
                        lod.parts[i].drawOverlay(*tattoo);
                        break;
                    }
                }
            }
            // Code removed for brevity

            break;
        }
}

In-game, this code works, but I thought that was because of me calling cskel.setMatrix() to get the desired lod level which I can't do during character creation since I am only using a MeshPtr nothing more.

I have tried applying the tattoo to all LODs (looping through all i-th levels of LOD and calling drawOverlay(...)) and still no sign of it. I have done all the basic checks to ensure the resource is usable (can apply it in-game using almost identical code to the tutorial) and that RM_OVERLAY is called as is drawOverlay(...) and it is all fine up to that point.

Any ideas?
(This post was last modified: 06-23-2012 12:06 AM by JonathonA.)
06-18-2012 04:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #2
RE: drawOverlay having no effect [unresolved]
Not sure but try,
PHP Code:
case RM_OVERLAY:
{
     
SetMatrix();

...
rest of code... 
06-22-2012 04:22 AM
Find all posts by this user Quote this message in a reply
JonathonA Offline
Member

Post: #3
RE: drawOverlay having no effect [unresolved]
Thank you, that worked perfectly smile
06-23-2012 12:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply