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 

How to use osg::ShaderBinary


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
qiaokun (Qiaokun Lefei)
Newbie


Joined: 09 May 2017
Posts: 5

PostPosted: Mon Jul 24, 2017 7:16 am    Post subject:
How to use osg::ShaderBinary
Reply with quote

Hi,

I want to know the use of 'osg::ShaderBinary'.
'osg:: ShaderBinary' is read from a binary file.
I just don't know how to generate a binary shader file.
Maybe use an offline shader compiler?
I hope someone tell me if it is necessary to use 'osg::ShaderBinary' in case of using a lot of shaders in a big project and how to use it.
Thank you!

Cheers,
Qiaokun
Back to top
View user's profile Send private message Send e-mail
mp3butcher (Julien Valentin)
Appreciator


Joined: 17 Feb 2010
Posts: 316

PostPosted: Mon Jul 24, 2017 3:15 pm    Post subject:
Re: How to use osg::ShaderBinary
Reply with quote

Hi
Program/Shader binary formats are vendor specific.
You can retrieve program binaries by hand with
Code:
Program::ProgramBinary* Program::PerContextProgram::compileProgramBinary(osg::State& state);

write binary to file and reuse it with ProgramBinary::assign()
but as it requires a proper context bound, you can't call it from an update callback.
Perhaps recording osg::Programs you wanna bake in a Camera PostDrawCallback can do the trick...
If you target ARM Mali GPU family, the easiest way to generate them is with malisc command line executable

However I didn't answer your original question about osg::ShaderBinary. It's seams a nonsense to read independant shader from the classic opengl monolitic program design...
My guess is getting a binary from a shader is proprietary stuff and it's the vendor charge to give you translation tools (and your charge to harass them if they don't)

Cheers


qiaokun wrote:
Hi,

I want to know the use of 'osg::ShaderBinary'.
'osg:: ShaderBinary' is read from a binary file.
I just don't know how to generate a binary shader file.
Maybe use an offline shader compiler?
I hope someone tell me if it is necessary to use 'osg::ShaderBinary' in case of using a lot of shaders in a big project and how to use it.
Thank you!

Cheers,
Qiaokun
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 fix for osgWrappers/serializers/Shade... jbaeuerle Submission 1 Wed Feb 09, 2011 9:46 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