OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Lazy Disabling without VertexFuncsAvailable


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Fabian Wiesel
Guest





PostPosted: Wed Sep 21, 2016 11:46 am    Post subject:
Lazy Disabling without VertexFuncsAvailable
Reply with quote

Hi,

I have converted my fixed function OSG program to a shader pipeline
(using setVertexAttribArray and shaders instead of the setVertexPointer et al)
and did run into some issues when disabling "UseVertexAttributeAliasing", and OSG is compiled with OPENGL_PROFILE=GLCORE
(So OSG_GL_VERTEX_FUNCS_AVAILABLE is unset). I tested the same code on a linux with OSG compiled for a FFP.
And there, the code works as expected.

A simple test program is here: https://github.com/fwiesel/vertexarrayfunctest

An API trace of the failing case shows the following interesting part:
...
glEnableVertexAttribArray(0)
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, NULL) # NULL is okay, the Array has been bound before
glDisableVertexAttribArray(0)
glDisableVertexAttribArray(1)
glDisableVertexAttribArray(2)
glDisableVertexAttribArray(11)
glDisableVertexAttribArray(12)
glDrawArrays(GL_POINTS, 0, 500)
...

No prior call to enable the array 1,2, 11, or 12 are issued.
The glDisableVertexAttribArray calls are coming from osg::State::applyDisablingOfVertexAttributes()
https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osg/State.cpp#L1296-L1304
as _useVertexAttributeAliasing is false, and each "<array>._lazy_disable" is true.
The state of "<array>._enabled" is never checked, as "disable<array>Pointer" is unconditionally mapped to the aliased "disableVertexAttribArray"

I think, the bug lies in the assumption of the lazy disabling, that if we do not use the aliasing, that there is a fixed function pipeline.
But if OSG_GL_VERTEX_FUNCS_AVAILABLE the functions are unconditionally mapped to aliased vertex attributes.

I think, the whole lazy disabling of aliased attributes is superfluous in that context, as each vertex attribute tracks its own state already,
and have proposed a patch accordingly: https://github.com/openscenegraph/OpenSceneGraph/pull/125
With the patch applied, the code runs as expected.

Does anyone have a different explanation or a better proposal for solving the issue? It doesn't seem to be the acceptable solution.

Cheers,
Fabian





------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Disabling plugins via CMake sam General 4 Tue Nov 08, 2016 1:05 am View latest post
No new posts Disabling plugins via CMake sam General 1 Tue Apr 19, 2016 5:48 pm View latest post
No new posts Disabling cameramanipulator in Compos... Bacttrack General 6 Sat Jul 19, 2014 8:17 am View latest post
No new posts zooming is disabling rain and clouds ... drout General 7 Mon Jun 23, 2014 3:49 am View latest post
No new posts disabling lighting in RTT scene Trajce Nikolov NICK General 4 Mon Dec 09, 2013 9:18 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP