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 

EXTERNAL: Re: Array of structs


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Rowley, Marlin R
Guest





PostPosted: Wed Apr 18, 2018 2:41 pm    Post subject:
EXTERNAL: Re: Array of structs
Reply with quote

Thanks for this. I’ll do more R&D and let you know what I come up with.

----------------------------------------
Marlin Rowley
Software Engineer, Staff

Missiles and Fire Control
972-603-1931 (office)
214-926-0622 (mobile)
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)

From: osg-users [mailto:] On Behalf Of Robert Osfield
Sent: Wednesday, April 18, 2018 9:39 AM
To: OpenSceneGraph Users <>
Subject: EXTERNAL: Re: Array of structs

Hi Marln,

On 18 April 2018 at 15:31, Rowley, Marlin R < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:

Is there an example of setting values in a uniform struct to pass to the shaders along with the shader code that uses these values?




I don't recall if we have an example illustrating setting of uniform struct - I haven't written all the OSG examples or other parts of the OSG code base so can only easily speak off the top of my head of what I've written or have worked closely with, the rest I just look up using grep Smile

Although I don't have an example I can point you at, I have used struct in Uniforms before by declaring the struct in the shader source, then in the osg::Uniform setup use a separate osg::Uniform for each uniform i.e.



-- GLSL code:

struct MyStruct
{

float a;

float b;

};



uniform MyStruct mystruct;

--- C++ code :



stateset->addUniform(new osg::Uniform("mystruct.a", 1.0f));
stateset->addUniform(new osg::Uniform("mystruct.b", 2.5f));

Hope this helps.

Robert.

------------------
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 About Interleaved Array Support mp3butcher General 4 Tue Oct 09, 2018 11:13 pm View latest post
No new posts EXTERNAL: Re: Value of a variable in... Rowley, Marlin R General 3 Fri Sep 28, 2018 1:39 pm View latest post
No new posts osgDB::OutputStream write array optim... Farshid Lashkari Submission 2 Thu Sep 20, 2018 11:17 pm View latest post
No new posts axis / axes with color array doesn't ... Steal General 0 Wed Sep 05, 2018 4:07 pm View latest post
No new posts EXTERNAL: Re: LookAt() function param... Rowley, Marlin R General 0 Mon Aug 13, 2018 2:59 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