Wojciech Lewandowski | 25 Apr 14:11 2015
Picon

osg::LineSegment intersect with Box and Sphere inconsistency

Hi, Robert,

I have just stumbled on small issue in my intersection code which turned out to be related to different interpretation of r2 param returned by LineSegment::intersect( BoundingBox, r1, r2 ) and LineSegment::intersect( BoundingSphere, r1, r2 ). 

Example Code:

osg::BoundingBox box( -1,-1,-1, 1, 1, 1 );
osg::BoundingSphere sphere( box );                
osg::ref_ptr< osg::LineSegment > diagonal = new osg::LineSegment( box._min, box._max );

double box_r1, box_r2;                
diagonal->intersect( box, box_r1, box_r2 );

double sphere_r1, sphere_r2;
diagonal->intersect( sphere, sphere_r1, sphere_r2 );

printf( "Box r1=%.0f r2=%.0f   Sphere r1=%.0f r2=%.0f \n", box_r1, box_r2, sphere_r1, sphere_r2 );

Output:

Box r1=0 r2=0   Sphere r1=0 r2=1

Is that a bug or deliberate design ?

Cheers,
Wojtek Lewandowski
<div><div dir="ltr">Hi, Robert,<div><br></div>
<div>I have&nbsp;just&nbsp;stumbled on small issue in my intersection code which turned out to be related to different interpretation of r2 param returned by LineSegment::intersect( BoundingBox, r1, r2 ) and LineSegment::intersect( BoundingSphere, r1, r2 ).&nbsp;</div>
<div><br></div>
<div>Example Code:</div>
<div>
<div><br></div>
<div><div>
<div>osg::BoundingBox box( -1,-1,-1, 1, 1, 1 );</div>
<div>osg::BoundingSphere sphere( box ); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
<div>osg::ref_ptr&lt; osg::LineSegment &gt; diagonal = new osg::LineSegment( box._min, box._max );</div>
<div><br></div>
<div>double box_r1, box_r2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
<div>diagonal-&gt;intersect( box, box_r1, box_r2 );</div>
<div><br></div>
<div>double sphere_r1, sphere_r2;</div>
<div>diagonal-&gt;intersect( sphere, sphere_r1, sphere_r2 );</div>
<div><br></div>
<div>printf( "Box r1=%.0f r2=%.0f &nbsp; Sphere r1=%.0f r2=%.0f \n", box_r1, box_r2, sphere_r1, sphere_r2 );</div>
</div></div>
<div><br></div>
<div>Output:</div>
</div>
<div><br></div>
<div>Box r1=0 r2=0 &nbsp; Sphere r1=0 r2=1<br>
</div>
<div><br></div>
<div>Is that a bug or deliberate design ?</div>
<div><br></div>
<div>Cheers,</div>
<div>Wojtek Lewandowski</div>
</div></div>
Trajce Nikolov NICK | 24 Apr 11:29 2015
Picon

osgSim::LightPointNode and LightSpacePerspectiveShadowMapDB

Hi all,

my scene uses the mentioned shadowing technique. Also I have in the scene lightpoints. For the lightpoints node I am disabling the shaders by setting an empty osg::Program. For some reason, the lightpoints are still affected by the shadow technique. I have set the LightPointNodes nodemask to not recieve or cast shadows but still the same. Any clue?

Thanks a lot!

Nick

--
trajce nikolov nick
<div><div dir="ltr">
<div>
<div>
<div>Hi all,<br><br>
</div>my scene uses the mentioned shadowing technique. Also I have in the scene lightpoints. For the lightpoints node I am disabling the shaders by setting an empty osg::Program. For some reason, the lightpoints are still affected by the shadow technique. I have set the LightPointNodes nodemask to not recieve or cast shadows but still the same. Any clue?<br><br>
</div>Thanks a lot!<br><br>
</div>Nick<br clear="all"><div><div><div><div>
<br>-- <br><div class="gmail_signature">trajce nikolov nick<br>
</div>
</div></div></div></div>
</div></div>
yoshiyuki yamamoto | 24 Apr 11:03 2015
Picon

install error : libEGL.so does not exist

Hello OSG Users,

The installation error on libEGL.so was occurred.
The file exist as shown below.
survey <at> SURVEY-C11:~/OpenSceneGraph-3.2.2-rc2/build$ ls /usr/lib/x86_64-linux-gnu/libEGL.so
/usr/lib/x86_64-linux-gnu/libEGL.so

The log message while installing using cmake is shown as below.
Let me know how to solve it.

survey <at> SURVEY-C11:~/OpenSceneGraph-3.2.2-rc2/build$ cmake ..
-- checking for module 'gta'
--   package 'gta' not found
-- Could NOT find CURL (missing:  CURL_LIBRARY CURL_INCLUDE_DIR)
-- Could NOT find SDL (missing:  SDL_LIBRARY SDL_INCLUDE_DIR)
-- checking for module 'poppler-glib'
--   package 'poppler-glib' not found
-- checking for module 'librsvg-2.0>=2.35'
--   package 'librsvg-2.0>=2.35' not found
-- checking for module 'gtkglext-x11-1.0'
--   package 'gtkglext-x11-1.0' not found
-- Boost version: 1.55.0
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfig.cmake:27 (message):
  The imported target "Qt5::Gui" references the file

     "/usr/lib/x86_64-linux-gnu/libEGL.so"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:23 (_qt5_Gui_check_file_exists)
  /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:49 (_qt5gui_find_extra_libs)
  /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfig.cmake:155 (include)
  /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:100 (find_package)
  CMakeLists.txt:594 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "/home/survey/OpenSceneGraph-3.2.2-rc2/CMakeFiles/CMakeOutput.log".
See also "/home/survey/OpenSceneGraph-3.2.2-rc2/CMakeFiles/CMakeError.log".


--
 ------------------------------------------------------------
愛知工業大学工学部土木工学科
山本義幸
〒470-0392 愛知県豊田市八草町八千草1247
TEL:(0565)48-8121(代表)、FAX:(0565)48-3749(代表)
HP: http://www.ait.ac.jp/index.html
Mail: y_yamamoto-3ovFhFOsaHbtP0S62TOXqw@public.gmane.org
 ------------------------------------------------------------
Department of Civil Engineering,
Faculty of Engineering,
Aichi Institute of Technology.
Yoshiyuki Yamamoto
1247 Yachikusa, Yakusa Cho, Toyota, Aichi 470-0392 JAPAN
TEL:+81-565-48-8121 FAX:+81-565-48-3749
HP: http://www.ait.ac.jp/index.html
Mail: y_yamamoto-3ovFhFOsaHbtP0S62TOXqw@public.gmane.org
<div><div dir="ltr">
<div>
<div>
<div>Hello OSG Users,<br><br>
</div>The installation error on libEGL.so was occurred.<br>
</div>
<div>The file exist as shown below.<br>survey <at> SURVEY-C11:~/OpenSceneGraph-3.2.2-rc2/build$ ls /usr/lib/x86_64-linux-gnu/libEGL.so<br>/usr/lib/x86_64-linux-gnu/libEGL.so<br><br>
</div>The log message while installing using cmake is shown as below.<br>
</div>Let me know how to solve it.<br><div>
<br>survey <at> SURVEY-C11:~/OpenSceneGraph-3.2.2-rc2/build$ cmake ..<br>-- checking for module 'gta'<br>--&nbsp;&nbsp; package 'gta' not found<br>-- Could NOT find CURL (missing:&nbsp; CURL_LIBRARY CURL_INCLUDE_DIR) <br>-- Could NOT find SDL (missing:&nbsp; SDL_LIBRARY SDL_INCLUDE_DIR) <br>-- checking for module 'poppler-glib'<br>--&nbsp;&nbsp; package 'poppler-glib' not found<br>-- checking for module 'librsvg-2.0&gt;=2.35'<br>--&nbsp;&nbsp; package 'librsvg-2.0&gt;=2.35' not found<br>-- checking for module 'gtkglext-x11-1.0'<br>--&nbsp;&nbsp; package 'gtkglext-x11-1.0' not found<br>-- Boost version: 1.55.0<br>CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfig.cmake:27 (message):<br>&nbsp; The imported target "Qt5::Gui" references the file<br><br>&nbsp;&nbsp;&nbsp;&nbsp; "/usr/lib/x86_64-linux-gnu/libEGL.so"<br><br>&nbsp; but this file does not exist.&nbsp; Possible reasons include:<br><br>&nbsp; * The file was deleted, renamed, or moved to another location.<br><br>&nbsp; * An install or uninstall procedure did not complete successfully.<br><br>&nbsp; * The installation package was faulty and contained<br><br>&nbsp;&nbsp;&nbsp;&nbsp; "/usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake"<br><br>&nbsp; but not all the files it references.<br><br>Call Stack (most recent call first):<br>&nbsp; /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:23 (_qt5_Gui_check_file_exists)<br>&nbsp; /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:49 (_qt5gui_find_extra_libs)<br>&nbsp; /usr/lib/x86_64-linux-gnu/cmake/Qt5Gui/Qt5GuiConfig.cmake:155 (include)<br>&nbsp; /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:100 (find_package)<br>&nbsp; CMakeLists.txt:594 (FIND_PACKAGE)<br><br><br>-- Configuring incomplete, errors occurred!<br>See also "/home/survey/OpenSceneGraph-3.2.2-rc2/CMakeFiles/CMakeOutput.log".<br>See also "/home/survey/OpenSceneGraph-3.2.2-rc2/CMakeFiles/CMakeError.log".<br><br clear="all"><div><div><div>
<br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">&nbsp;------------------------------------------------------------<br>&#24859;&#30693;&#24037;&#26989;&#22823;&#23398;&#24037;&#23398;&#37096;&#22303;&#26408;&#24037;&#23398;&#31185;<br>&#23665;&#26412;&#32681;&#24184;<br>&#12306;470-0392&#12288;&#24859;&#30693;&#30476;&#35914;&#30000;&#24066;&#20843;&#33609;&#30010;&#20843;&#21315;&#33609;1247<br>TEL:(0565)48-8121&#65288;&#20195;&#34920;&#65289;&#12289;FAX:(0565)48-3749&#65288;&#20195;&#34920;&#65289;<br>HP: <a href="http://www.ait.ac.jp/index.html" target="_blank">http://www.ait.ac.jp/index.html</a><br>Mail: <a href="mailto:y_yamamoto@..." target="_blank">y_yamamoto@...</a><br>&nbsp;------------------------------------------------------------<br>Department of Civil Engineering,<br>Faculty of Engineering,<br>Aichi Institute of Technology.<br>Yoshiyuki Yamamoto<br>1247 Yachikusa, Yakusa Cho, Toyota, Aichi 470-0392 JAPAN<br>TEL:+81-565-48-8121 FAX:+81-565-48-3749<br>HP: <a href="http://www.ait.ac.jp/index.html" target="_blank">http://www.ait.ac.jp/index.html</a><br>Mail: <a href="mailto:y_yamamoto@..." target="_blank">y_yamamoto@...</a>
</div></div></div></div>
</div></div></div>
</div>
</div></div>
Georg Gast | 23 Apr 19:44 2015
Picon
Picon

AnimationPath + AnimationPathCallback

Hi,

right now i try to move to different objects in my scene. I attached a own AnimamationPathCallback to 2
MatrixTransform Nodes in my scene.

My goal is, that both nodes move independently but each should notify me, when it animation is finished.

Here is my callback

Code:

// create the update callback
struct Notify : osg::AnimationPathCallback
{
    Notify(osg::AnimationPath* p, bool& animation_done)
    : osg::AnimationPathCallback(p) , m_animation_done(animation_done) {}

    virtual void operator()(osg::Node*  node,
                            osg::NodeVisitor*  nv)
    {
        osg::AnimationPathCallback::operator()(node,nv);
        if (m_animation_done)
            return;

        osg::MatrixTransform* p_mt =
            dynamic_cast<osg::MatrixTransform*>(node);
        if (p_mt)
        {
            auto p_down = dynamic_cast<Notify*>(p_mt->getUpdateCallback());
            if (p_down == this)
            {
                auto p_path = getAnimationPath();
                double current_time = getAnimationTime();
                double max_time = p_path->getLastTime();

                if (current_time >= max_time)
                {
                    m_animation_done = true;
                }
            }
        }
    }

    bool& m_animation_done;
};

This callback works when only one is attached to a node in the scene. When i attach two of them, with different
animation path, just the one of them gets updated. In fact, i bought both OpenSceneGraph Books, but i could
not find a hint why this should not happen.

This way i start the animations ....

Code:

void update_controller::start_animation(const std::vector<int>& animation, bool& animation_done)
{
    animation_done = false;

    osg::ref_ptr<osg::AnimationPath> p_path =
        new osg::AnimationPath;

    // only one shot
    p_path->setLoopMode(osg::AnimationPath::NO_LOOPING);

    // define the control points
    assert(animation.size() >= 2);
    static const osg::Vec3 delta_z( 0, 0, 1 );

    size_t p = 0; float time = 0.0f;
    osg::AnimationPath::ControlPoint cp(m_all_pos[animation[p]]);
    p_path->insert(time, cp); time+= 0.1f;

    cp = osg::AnimationPath::ControlPoint(m_all_pos[animation[p]] - delta_z);
    p_path->insert(time, cp); time+= 0.1f;
    p++;
    assert(p == 1);

    while (p < animation.size()-1)
    {
        cp = osg::AnimationPath::ControlPoint(m_all_pos[animation[p]] - delta_z);
        p_path->insert(time, cp); time+= 0.1f;
        p++;
    }

    cp = osg::AnimationPath::ControlPoint(m_all_pos[animation[p]]);
    p_path->insert(time, cp); time+= 0.1f;

    osg::ref_ptr<Notify> p_animation_cb =
        new Notify(p_path.get(), animation_done );

    // set this callback to the desired pins matrix
    assert(m_id_player_pin != -1);
    assert(m_pins[m_id_player_pin] != nullptr);
    m_pins[m_id_player_pin]->setUpdateCallback(p_animation_cb.get());    
}

I guess, it is just a small thing. This is my first OSG project and in fact it is my first problem, which i cant
solve by reading the books .... :(

Thank you!

Cheers,
Georg

P.S.: I dont know why the forum shows my "4 space tabs" as ??? I replaced my "\t" by four spaces in my editor ....  :?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63519#63519

Trajce Nikolov NICK | 22 Apr 23:38 2015
Picon

osgText::Text::GlyphQuads change in the recent versions

Hi Robert,

I did port of my app from 3.3.1 to the latest 3.3.7. All went smooth only one line of code I want to #ifdef with OSG_VERSION due to the apps still depend on 3.3.1. And this is the usage of ref_ptrs in GlyphQuads coordiantes. Can you recall from which version they becomed ref_ptrs of Arrays? It will save me time to go across the code of each version from 3.3.1

Thanks a lot as always

Nick

--
trajce nikolov nick
<div><div dir="ltr">
<div>
<div>
<div>Hi Robert,<br><br>
</div>I did port of my app from 3.3.1 to the latest 3.3.7. All went smooth only one line of code I want to #ifdef with OSG_VERSION due to the apps still depend on 3.3.1. And this is the usage of ref_ptrs in GlyphQuads coordiantes. Can you recall from which version they becomed ref_ptrs of Arrays? It will save me time to go across the code of each version from 3.3.1<br><br>
</div>Thanks a lot as always<br><br>
</div>Nick<br clear="all"><div><div><div><div>
<br>-- <br><div class="gmail_signature">trajce nikolov nick<br>
</div>
</div></div></div></div>
</div></div>
Leandro Linardos | 22 Apr 15:41 2015
Picon

Multiple color layers for an osgTerrain::TerrainTile

Hi,

I'm working with terrain data in a quad-tree structure at differents LODs. 

I want to show elevation data at LOD A and imagery data at level A+1, so, there are 4 color layers and 1
heightfield layer. I set the locators in each layer, so each one is well located. Each color layer (with the
imagery data) covers only a quarter of the tile, fulfilling the remaing three quartes with black (in fact
it depends on the wrap mode of the texture). Each tile quarter is composed with three black color areas and
one imagery data area. 

In this scenary, the problem is that the imagery data is lost when are joined with the black area of the others
layers. The result is black color painting all the tile.

Is there a way to fulfill the remaining of a layer with transparent color instead of black? Another ideas?
Maybe there is something I'm not seeing.

(I get it working composing the 4 imagery images in one with the double of width and height, or adding the
alpha 0 quartes directly in the source image getting 4 images with the double of width and height, but I
would want use the data sources as they are, without preprocessing).

Thank you!

Cheers,
Leandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63505#63505

Mike Connell | 22 Apr 15:12 2015
Picon

Orthographic projection and LOD nodes

Hi!

I have a problem viewing a PagedLOD terrain database together with a top-down bird's eye orthographic projection.

Since the tiles furthest from the center of the screen are further from the eye point, they are rendered at a lower LOD level (the database uses the DISTANCE_FROM_EYE_POINT RangeMode). What I would like to achieve is a constant LOD scale across the entire view for a given ortho zoom level / "height".

Has anyone come across - and solved this problem before?

My idea so far involves fiddling with the CullVisitor - basically counteracting the effect of the distance to eyepoint calculation by modifying the LOD bias in the opposite direction. I am not 100% sure this is feasible, or necessary, or ideal.

Is there a simpler solution?

Thanks!

Mike


<div><div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi!<br><br>
</div>I have a problem viewing a PagedLOD terrain database together with a top-down bird's eye orthographic projection. <br><br>
</div>Since the tiles furthest from the center of the screen are further from the eye point, they are rendered at a lower LOD level (the database uses the DISTANCE_FROM_EYE_POINT RangeMode). What I would like to achieve is a constant LOD scale across the entire view for a given ortho zoom level / "height".<br><br>
</div>Has anyone come across - and solved this problem before?<br><br>
</div>My idea so far involves fiddling with the CullVisitor - basically counteracting the effect of the distance to eyepoint calculation by modifying the LOD bias in the opposite direction. I am not 100% sure this is feasible, or necessary, or ideal.<br><br>
</div>
<div>Is there a simpler solution?<br><br>
</div>
<div>Thanks!<br><br>
</div>
<div>Mike<br>
</div>
<br>
</div>
<br>
</div></div>
Leandro Linardos | 22 Apr 06:04 2015
Picon

[osgPlugins] Using SDL plugin

Hi,

I'm trying to control my camera with a Joystick using the SDL plugin, but I think I'm missing something.

The instance of a JoystickDevice comes from osgDB, when we read for a file with name "joystick.sdl". But,
how I can add new key mappings if I can't include the JoystickDevice type (all plugin's files are in src)?

Thank you!

Cheers,
Leandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63496#63496

allan xia | 22 Apr 11:34 2015
Picon

attribute variable transfers error

 I need to distinguish the vertexs in different models in vertex shaders and fragment shaders  .so I use a nodevisitor to transfer a attribute variable to the vertex shaders.as follows:
I transfer different value to the vertex  shader if the type is dedined different. 

class AnalysisNodeVisitor :public osg::NodeVisitor{
public:
AnalysisNodeVisitor(INPUTTYPE type):osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN){
m_InputType=type;
}
virtual void apply(osg::Geode &node)
{
for ( unsigned int i=0; i<node.getNumDrawables(); ++i )
{
osg::Geometry* geom = dynamic_cast<osg::Geometry*>(node.getDrawable(i) );
if ( geom ){
osg::FloatArray *fa=new osg::FloatArray;
switch(m_InputType){
case INPUTTEXTURE:
{
fa->push_back(0.1);
break;
}
case INPUTMATERIAL:
{
fa->push_back(0.2);
break;
}
default :
{
fa->push_back(0.9);
}
}
geom->setVertexAttribArray(6,fa);
geom->setVertexAttribBinding(6,osg::Geometry::BIND_OVERALL);
}
}
traverse( node );
}
virtual void apply(osg::Node &node){
traverse(node);
}
public:
INPUTTYPE m_InputType;
};

and bind the attribute to the shader:
program->addBindAttribLocation("modelType",6);

but when I use the AnalysisNodeVisitor,I occur a error.

AnalysisNodeVisitor anvA(INPUTTEXTURE);
nodeA.accept(anvA);
AnalysisNodeVisitor anvB(INPUTMATERIAL);
nodeB.accept(anvB);

and in the vertex shader  modelType variable of vertexs in nodeA should be 0.1 and modeType variable of vertexs in NodeB should be 0.2 ,but actually modeType variable of all vertex is 0.2 .It seems nodeB.accept(anvB) override the modeType variable of nodeA. what is wrong with it?Am I misunderstand it ?
<div><div dir="ltr">
<span>&nbsp;I need to distinguish the vertexs in different models in vertex shaders and fragment shaders &nbsp;.so I use a nodevisitor to transfer a attribute variable to the vertex&nbsp;</span><a href="http://shaders.as/" target="_blank">shaders.as</a><span>&nbsp;follows:</span><div>I transfer different value to the vertex &nbsp;shader if the type is dedined different.&nbsp;</div>
<div>
<br><div>
<div>class AnalysisNodeVisitor :public osg::NodeVisitor{</div>
<div>public:</div>
<div>
<span>	</span>AnalysisNodeVisitor(INPUTTYPE type):osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN){</div>
<div>
<span>		</span>m_InputType=type;</div>
<div>
<span>	</span>}</div>
<div>
<span>	</span>virtual void apply(osg::Geode &amp;node)</div>
<div>
<span>	</span>{</div>
<div>
<span>		</span>for ( unsigned int i=0; i&lt;node.getNumDrawables(); ++i )</div>
<div>
<span>		</span>{</div>
<div>
<span>			</span>osg::Geometry* geom = dynamic_cast&lt;osg::Geometry*&gt;(node.getDrawable(i) );</div>
<div>
<span>			</span>if ( geom ){</div>
<div>
<span>				</span>osg::FloatArray *fa=new osg::FloatArray;</div>
<div>
<span>				</span>switch(m_InputType){</div>
<div>
<span>					</span>case INPUTTEXTURE:</div>
<div>
<span>						</span>{</div>
<div>
<span>							</span>fa-&gt;push_back(0.1);</div>
<div>
<span>							</span>break;</div>
<div>
<span>						</span>}</div>
<div>
<span>					</span>case INPUTMATERIAL:</div>
<div>
<span>						</span>{</div>
<div>
<span>							</span>fa-&gt;push_back(0.2);</div>
<div>
<span>							</span>break;</div>
<div>
<span>						</span>}</div>
<div>
<span>					</span>default :</div>
<div>
<span>						</span>{</div>
<div>
<span>							</span>fa-&gt;push_back(0.9);</div>
<div>
<span>						</span>}</div>
<div>
<span>				</span>}</div>
<div>
<span>				</span>geom-&gt;setVertexAttribArray(6,fa);</div>
<div>
<span>				</span>geom-&gt;setVertexAttribBinding(6,osg::Geometry::BIND_OVERALL);</div>
<div>
<span>			</span>}</div>
<div>
<span>		</span>}</div>
<div>
<span>		</span>traverse( node );</div>
<div>
<span>	</span>}</div>
<div>
<span>	</span>virtual void apply(osg::Node &amp;node){</div>
<div>
<span>		</span>traverse(node);</div>
<div>
<span>	</span>}</div>
<div>public:</div>
<div>
<span>	</span>INPUTTYPE m_InputType;</div>
<div>};</div>
</div>
</div>
<div><br></div>
<div>and bind the attribute to the shader:</div>
<div>
<span>	</span>program-&gt;addBindAttribLocation("modelType",6);<br>
</div>
<div><br></div>
<div>but when I use the AnalysisNodeVisitor,I occur a error.</div>
<div><br></div>
<div>AnalysisNodeVisitor anvA(INPUTTEXTURE);<br>
</div>
<div>nodeA.accept(anvA);</div>
<div>AnalysisNodeVisitor anvB(INPUTMATERIAL);<br>
</div>
<div>nodeB.accept(anvB);</div>
<div><br></div>
<div>and in the vertex shader &nbsp;modelType variable of vertexs in nodeA should be 0.1 and modeType variable of vertexs in NodeB should be 0.2 ,but actually modeType variable of all vertex is&nbsp;<a href="http://0.2.it/" target="_blank">0.2 .It</a>&nbsp;seems nodeB.accept(anvB) override the modeType variable of nodeA. what is wrong with it?Am I misunderstand it ?</div>
</div></div>
Trajce Nikolov NICK | 21 Apr 00:47 2015
Picon

#pragmatic composition : setDefine

Hi Robert, all,

I finally ported all my shaders to the this new thing. I have a question. Probably simple but will go anyway

in my shader I have something like

#define MYDEFINE
.. do stuff here ...
#endif

at the root of the scene I have
stateSet->setDefine("MYDEFINE");

how can I fornid this define somewhere down the tree ? Simple removing it is not helping (as expected I guess).

Any sample how the defines with Values set works?

Thanks a bunch !

Nick

--
trajce nikolov nick
<div><div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>Hi Robert, all,<br><br>
</div>I finally ported all my shaders to the this new thing. I have a question. Probably simple but will go anyway<br><br>
</div>in my shader I have something like<br><br>
</div>#define MYDEFINE<br>
</div>.. do stuff here ...<br>
</div>#endif<br><br>
</div>at the root of the scene I have<br>
</div>stateSet-&gt;setDefine("MYDEFINE");<br><br>
</div>how can I fornid this define somewhere down the tree ? Simple removing it is not helping (as expected I guess).<br><br>
</div>Any sample how the defines with Values set works?<br><br>
</div>Thanks a bunch !<br><br>
</div>Nick<br clear="all"><div><div><div><div><div><div><div><div><div><div><div><div><div>
<br>-- <br><div class="gmail_signature">trajce nikolov nick<br>
</div>
</div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>
Nitin Mishra | 20 Apr 07:55 2015
Picon

Reg: Warning: detected openGL error, invalid enumerant, after RenderBin::draw()

Hi,

I am using OSG v3.3.6543 with OSGEarth , i have build OSG & OSGEarth from source using Visua studio 2013 c++ compiler, thing is working fine but during end of OSGEarth_viewer/osgviewer it is showing following  warning-

"Warning: detected openGL error, invalid enumerant, after RenderBin::draw()"

if somebody know the reason & way to remove this warning, then plzzz help me

Thanks & Regards
Nitin Mishra
<div><div dir="ltr">Hi,<br><br><div>I am using OSG&nbsp;v3.3.6543 with OSGEarth , i have build OSG &amp; OSGEarth from source using Visua studio 2013 c++ compiler, thing is working fine but during end of OSGEarth_viewer/osgviewer it is showing following &nbsp;warning-</div>
<div><br></div>
<div>"Warning: detected openGL error, invalid enumerant, after RenderBin::draw()"<br>
</div>
<div><br></div>
<div>if somebody know the reason &amp; way to remove this warning, then plzzz help me</div>
<div><br></div>
<div>Thanks &amp; Regards</div>
<div>Nitin Mishra</div>
</div></div>

Gmane