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 

support for #extension


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission
View previous topic :: View next topic  
Author Message
d_a_heitbrink (David Heitbrink)
User


Joined: 23 Sep 2013
Posts: 37

PostPosted: Wed Jan 11, 2017 3:16 pm    Post subject:
support for #extension
Reply with quote

In the attached file I have added support for #extension in shaders, GLSL requires definitions to happen after the optional #extension.

Also what is the currently preferred method of submitting code? I have some code that adds support for uint64+int64 uniform types + an example that uses bindless textures.
Back to top
View user's profile Send private message Send e-mail
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10777

PostPosted: Wed Jan 11, 2017 3:45 pm    Post subject:
support for #extension
Reply with quote

Hi David,

You could can either generate a PR on github or post complete modified
to osg-submissions.

With your modifications which version of the OSG are using as a base?

Robert.

On 11 January 2017 at 15:16, David Heitbrink <> wrote:
Quote:
In the attached file I have added support for #extension in shaders, GLSL requires definitions to happen after the optional #extension.

Also what is the currently preferred method of submitting code? I have some code that adds support for uint64+int64 uniform types + an example that uses bindless textures.

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








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
d_a_heitbrink (David Heitbrink)
User


Joined: 23 Sep 2013
Posts: 37

PostPosted: Wed Jan 11, 2017 4:59 pm    Post subject:
Reply with quote

It looks like its the openscenegraph-3.5.5, I based it off a recent pull from:

https://github.com/openscenegraph/OpenSceneGraph

The modified code start at line 1228, it is here:

<code>
if ( declPos != std::string::npos )
{
declPos = source.find(" ", declPos); // move to the first space after "#version"
declPos = source.find_first_not_of(std::string(" "), declPos); // skip all the spaces until you reach the version number
std::string versionNumber(source, declPos, 3);
int glslVersion = atoi(versionNumber.c_str());
OSG_INFO<<"shader version found: "<< glslVersion <<std::endl;
if (glslVersion >= 130) attributeQualifier = "in ";
// found the string, now find the next linefeed and set the insertion point after it.
declPos = source.find( '\n', declPos );
declPos = declPos != std::string::npos ? declPos+1 : source.length();
}
else
{
declPos = 0;
}

std::string::size_type extPos = source.rfind( "#extension " );
if ( extPos != std::string::npos )
{
// found the string, now find the next linefeed and set the insertion point after it.
declPos = source.find( '\n', extPos );
declPos = declPos != std::string::npos ? declPos+1 : source.length();
}
</code>
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission 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 More FBX map support Farshid Lashkari Submission 0 Wed Mar 15, 2017 6:35 pm View latest post
No new posts GLSL 1.3 support for vertex-attrib al... robertosfield Submission 0 Fri Dec 23, 2016 5:08 pm View latest post
No new posts IGES File support plugin for OpenScen... robertosfield Submission 5 Wed Nov 30, 2016 7:16 pm View latest post
No new posts More FBX map support Farshid Lashkari Submission 0 Tue Nov 22, 2016 6:57 pm View latest post
No new posts a question on extension functions con... kornerr General 0 Sat Nov 05, 2016 4:56 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