Hi all,
 
we're trying to build the recent OpenSG source with vs2017 (vc141). We noticed that the compiler produces faulty code for release builds when optimization (/O2) is activated.
 
OSGTextVectorFace.cpp
Line 273:
indexEnd = tIt->second;
 
Here, the assignment to indexEnd nevers happens. Assembly looks like this:
 
000007FEE316324A  mov         r8d,dword ptr [r12+4]  
000007FEE316324F  mov         dword ptr [index],r8d
 
Looks like the value is written to a variable 'index' instead of indexEnd... :-(
 
Do you have any ideas how to fix this without deactivating optimizations? Do you have experienced other similar problems?
 
Thanks in advance..
 
Regards,
Michael
 
 
 
Gesendet: Donnerstag, 16. November 2017 um 16:06 Uhr
Von: "Johannes Brunen" <jbru...@datasolid.de>
An: "carsten_neum...@gmx.net" <carsten_neum...@gmx.net>
Cc: "opensg-users@lists.sourceforge.net" <opensg-users@lists.sourceforge.net>
Betreff: [Opensg-users] OpenSG2: Stages and material overriding

Hi Carsten,

 

I need a little help with understanding the material overriding process.

 

My scene graph looks like the following sketch:

 

    root

     |

  MyStage

     |

MaterialChunk-

OverrideGroup

     |

   Scene

     |

  Material

     |

Geometry

 

At first, if the MyStage node is not present in the scene the idea of the MaterialChunkOverride group is to provide a ShaderProgramChunk that is used for all the geometry found below of the scene. Now, the stage MyStage should render its child tree with a special shader (or without any shader) into some FBOs. For instance shadows. Then, the shader of the MaterialChunkOverrideGroup should take credit from the information provided by the stage.

 

Now, I have the impression, that I always have the MaterialChunkOverrideGroup shader in the way when rendering into the FBOs. I.e. I am unable to force the usage of my special stage material alone.

 

How, should I setup things correctly?

 

My stage goes as follows:

 

MyStage::renderEnter

{

    ...

    //ract->disableDefaultPartition();

 

    this->beginPartitionGroup(ract);

    {

        this->pushPartition(ract, RenderPartition::CopyAll);

        {

            this->pushPartition(ract);

            {

                RenderPartition* pPart = ract->getActivePartition();

                pPart->setRenderTarget(data.pFBO);

                ...

 

                // _lightPassMaterial is MaterialChunk with or without shader chunk

                pPart->overrideMaterial(_lightPassMaterial, ract->getActNode());        // (*)

 

                recurseFromThis(a);

                ract->useNodeList(false);

 

                pPart->overrideMaterial(NULL, ract->getActNode());

            }

            this->popPartition(a);

 

 

            ract->pushState();

 

            ract->addOverride(_myTexObj->getClassId() + iUnit, _myTexObj);

            ract->addOverride(ShaderProgramChunk::getStaticClassId(), _injectProgChunk);

   

            this->recurseFromThis(ract); // (**)

            ract->useNodeList(false);

 

            ract->popState();

        }

        this->popPartition(ract);

 

    }

    this->endPartitionGroup(ract);

 

    return Action::Skip;

}

 

Is this a sensible approach for what I have in mind?

Is my handling of the partition groups correct?

I still have not fully grasped, when I have to use the disableDefaultPartition call and what is its intention.

Are all useNodeList(false) calls are necessary?

The code line (*) should completely setup my material for the special stage rendering. How to force that?

Is the chunk overriding process generally problematic in the context of stages and shaders?

Can I replace the material incl. shaders at line (*)   somehow?

Is it correct for rendering the final scene to use the recurseFromThis call at (**) or is it appropriate to leave the renderEnter function with a return Continue?

 

Can you help me a little with this? Actually, I have come a long way and hope to get around this to get my stage running.

 

Best,

Johannes

 

 

 

------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to