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 

Fixed pipeline lighting to shaders


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


Joined: 12 Apr 2019
Posts: 28

PostPosted: Sun Aug 11, 2019 5:18 am    Post subject:
Fixed pipeline lighting to shaders
Reply with quote

Hi,


Does OSG has some shaders that replicates the fixed pipeline of OpenGL (1.x) with the 8 lights?


Thank you,
Catalin

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Trajce Nikolov NICK
Guest





PostPosted: Sun Aug 11, 2019 5:23 am    Post subject:
Fixed pipeline lighting to shaders
Reply with quote

Hi Catalin,

Lighting is very interesting topic in OpenGL (and OSG). Have a look at this opensource project for inspiration about lighting with shaders ( http://openig.compro.net/ ). It is hosted on github where you can find the sources including the shaders. https://github.com/CCSI-CSSI/MuseOpenIG .. It has implementation of Forward+ where you can have hunderds of lights in realtime. Here some video https://www.youtube.com/watch?v=l1EXIYBVH5g .. This project is stopped but it is still interesting and I know few companies is using it for simulation


On Sat, Aug 10, 2019 at 7:49 AM Catalin < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi,


Does OSG has some shaders that replicates the fixed pipeline of OpenGL (1.x) with the 8 lights?


Thank you,
Catalin


_______________________________________________
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



--
trajce nikolov nick

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12348

PostPosted: Sun Aug 11, 2019 5:48 am    Post subject:
Fixed pipeline lighting to shaders
Reply with quote

Hi Catalin,


On Sat, 10 Aug 2019 at 06:49, Catalin < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Does OSG has some shaders that replicates the fixed pipeline of OpenGL (1.x) with the 8 lights?



The osgUtil::ShaderGen can do a bit of this, it's not great but might help.


With shaders you have lots more possibilities than you do with the fixed function pipeline so as well as moving to shaders you take the opportunity to improve visual quality such as by introducing per pixel lighting rather than per vertex lighting that fixed pipeline constrains you to.


I see that Nick has suggested OpenIG.  I did some work it a couple of years ago and found performance issues that couldn't be resolved, so ended up implement a different approach to implementing large number of light sources that also ended up being simpler and better integrated into how the OSG normally works.   Unfortunately this work isn't mine to share as it's not open source.  I mention it as a word of caution and also encouragement, as it's possible to build pretty sophisticated lighting schemes ontop of the OSG, though it's not an entry user tasks.


An easier short term route is to get familiar with shaders.  There are some in the OpenSceneGraph-Data/shaders set that include lighting.



Cheers,

Robert.

 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
AnyOldName3 (Chris Djali)
User


Joined: 08 Sep 2017
Posts: 69

PostPosted: Sun Aug 11, 2019 6:09 pm    Post subject:
Reply with quote

Hi,

ShaderGen from 3D Labs is an old tool that can generate equivalent GLSL 1.2 shaders for a fairly large subset of FFP state. I've used it a fair amount to sanity-check things. If you just want a basic shader as a start point to drop into an FFP application, it's pretty good, but there are definitely things it doesn't cover.

Cheers,
Chris
Back to top
View user's profile Send private message
gwaldron (Glenn Waldron)
Appreciator


Joined: 25 Aug 2011
Posts: 246

PostPosted: Mon Aug 12, 2019 1:45 pm    Post subject:
Fixed pipeline lighting to shaders
Reply with quote

Here's some shader code you can use as a reference (not a complete solution on its own). There are also some links in the code comments you can research.

https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/PhongLighting.frag.glsl





On Sat, Aug 10, 2019, 1:49 AM Catalin < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi,


Does OSG has some shaders that replicates the fixed pipeline of OpenGL (1.x) with the 8 lights?


Thank you,
Catalin


_______________________________________________
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
View user's profile Send private message
FulltimeKiller
Newbie


Joined: 22 Aug 2019
Posts: 12

PostPosted: Tue Sep 10, 2019 2:59 am    Post subject:
Re: Fixed pipeline lighting to shaders
Reply with quote

gwaldron wrote:
Here's some shader code you can use as a reference (not a complete solution on its own). There are also some links in the code comments you can research.

https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/PhongLighting.frag.glsl





On Sat, Aug 10, 2019, 1:49 AM Catalin < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi,


Does OSG has some shaders that replicates the fixed pipeline of OpenGL (1.x) with the 8 lights?


Thank you,
Catalin


_______________________________________________
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


Thank you, gwaldron. I saw the post before. It added to my knowledge of OpenGL light.

I am building osgEarth now. I would try to dig the source of osgEarth. Does osgEarth use shader to implement light effect rather than glLight?
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 -> 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 Keeping camera fixed alasca General 3 Fri May 31, 2019 10:08 am View latest post
No new posts why does the adding of lighting shade... mirro General 0 Mon Feb 11, 2019 3:03 am 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 Value of a variable in shaders? Rowley, Marlin R General 4 Thu Sep 27, 2018 6:14 pm View latest post
No new posts Shaders with multiple views using Vie... robertosfield General 5 Wed May 09, 2018 9:20 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