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 

GLSL plugin static linking issue (recent master branch)


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
drewpts
Newbie


Joined: 28 Jul 2019
Posts: 3

PostPosted: Wed Aug 28, 2019 9:10 pm    Post subject:
GLSL plugin static linking issue (recent master branch)
Reply with quote

Hi,

First of all I pretty new to engine thus I may sound silly.

In my case OSG tends to load glsl dynamic library despite I wrote
USE_OSGPLUGIN(glsl) and linked with libosgdb_glsld.a.

As I had stuck with this I decided to get to the debug. So please let me show what I have found so far and what feels suspiciosly for me:
In function
Code:
ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFunctor,Options::CacheHintOptions cacheHint)


value of
Code:
useObjectCache= options ? (options->getObjectCacheHint()&cacheHint)!=0: false;

becomes equal true for FreeType plugin but false for GLSL plugin due to missed options in very first debug frame for GLSL plugin:

Code:
inline osg::ref_ptr<osg::Shader> readRefShaderFileWithFallback(osg::Shader::Type type, const std::string& filename, const char* fallback)
{
   return osgDB::readRefShaderFileWithFallback(type, filename, Registry::instance()->getOptions(), fallback);
}


If I got it right having useObjectCache as false ends up with search of dynamic library.

That could be incorrect observations... So if I wrong here - could somebody please help me getting GLSL thing to work properly?


Configuration:
Recent `master`: bd50af117bed340b14b5bf13da6a8efe893f4ce7
MacOS 10.14.6

-DAPPLE:BOOL="1"
-DCMAKE_BUILD_TYPE:STRING="Debug"
-DDYNAMIC_OPENTHREADS:BOOL="0"
-DBUILD_OSG_EXAMPLES:BOOL="1"
-DDYNAMIC_OPENSCENEGRAPH:BOOL="0"
-DBUILD_OSG_APPLICATIONS:BOOL="0"
-DOSG_GL3_AVAILABLE:BOOL="1"

Thank you!

Cheers,
Andrew
Back to top
View user's profile Send private message
Voerman, L.
Guest





PostPosted: Thu Aug 29, 2019 2:32 pm    Post subject:
GLSL plugin static linking issue (recent master branch)
Reply with quote

Hi Andrew,the options should not influence the library loading, it's the datafiles that can be cached. 
I'm just guessing here, but are you trying to load a file named "filename.glsl"? that would match the problem you see.
the glsl plugin is strange in that it does not support *.glsl files.
rename your datafile .vert , .frag or .geom as appropriate for the type of shader it contains.
Laurens.


On Wed, Aug 28, 2019 at 11:10 PM Andrew Poltavets < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi,

First of all I pretty new to engine thus I may sound silly.

In my case OSG tends to load glsl dynamic library despite I wrote
USE_OSGPLUGIN(glsl) and linked with libosgdb_glsld.a.

As I had stuck with this I decided to get to the debug. So please let me show what I have found so far and what feels suspiciosly for me:
In function
Code:
ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFunctor,Options::CacheHintOptions cacheHint)



value of
Code:
useObjectCache= options ? (options->getObjectCacheHint()&cacheHint)!=0: false;


becomes equal true for FreeType plugin but false for GLSL plugin due to missed options in very first debug frame for GLSL plugin:


Code:
inline osg::ref_ptr<osg::Shader> readRefShaderFileWithFallback(osg::Shader::Type type, const std::string& filename, const char* fallback)
{
   return osgDB::readRefShaderFileWithFallback(type, filename, Registry::instance()->getOptions(), fallback);
}



If I got it right having useObjectCache as false ends up with search of dynamic library.

That could be incorrect observations... So if I wrong here - could somebody please help me getting GLSL thing to work properly?


Configuration:
Recent `master`: bd50af117bed340b14b5bf13da6a8efe893f4ce7
MacOS 10.14.6

-DAPPLE:BOOL="1"
-DCMAKE_BUILD_TYPE:STRING="Debug"
-DDYNAMIC_OPENTHREADS:BOOL="0"
-DBUILD_OSG_EXAMPLES:BOOL="1"
-DDYNAMIC_OPENSCENEGRAPH:BOOL="0"
-DBUILD_OSG_APPLICATIONS:BOOL="0"
-DOSG_GL3_AVAILABLE:BOOL="1"

Thank you!

Cheers,
Andrew

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





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
drewpts
Newbie


Joined: 28 Jul 2019
Posts: 3

PostPosted: Fri Aug 30, 2019 5:40 pm    Post subject:
Reply with quote

Hi Laurens,

Thank you for your reply.

Debug session turned out that the problem happens for .vert file under the hood. I am trying to render simple text.

Here:
Code:
osgText::Font* font = osgText::readFontFile("/Library/Fonts/Andale Mono.ttf");
osgText::Text* text = new osgText::Text;
text->setFont(font);
text->setAxisAlignment(osgText::Text::XZ_PLANE);
text->setText("Hello world!", osgText::String::ENCODING_UTF8);


Thank you!

Andrew
Back to top
View user's profile Send private message
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 osgQt Material issue wroos General 1 Mon Sep 09, 2019 10:39 am View latest post
No new posts Please test OpenSceneGraph-3.6 branch... robertosfield General 1 Mon Jul 01, 2019 6:10 pm View latest post
No new posts Issue with osgt format on 3.6.x Riccardo Corsi General 1 Wed Apr 17, 2019 3:46 pm View latest post
No new posts Recent mods to XmlParser giving error... Trajce Nikolov NICK General 0 Wed Apr 17, 2019 11:09 am View latest post
No new posts Problems with dae plugin John Richardson Plugins [osgPlugins] 0 Thu Apr 11, 2019 5:00 pm 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