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 

Layered rendering with a geometry shader


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
AnyOldName3 (Chris Djali)
User


Joined: 08 Sep 2017
Posts: 57

PostPosted: Tue May 14, 2019 11:25 pm    Post subject:
Layered rendering with a geometry shader
Reply with quote

Hi,

I'm investigating using a geometry shader to render multiple shadow map cascades in one pass in OpenMW. While I've heard conflicting (but mostly negative) accounts of how much additional performance this can bring, I reckon it's likely to help, as OpenMW uses a ridiculous quantity of tiny drawables, causing a ridiculous number of draw calls when RTT passes are used, and there's no easy batching implementation as user/game scripts can add, remove, replace and relocate object with no notice. There are solutions in the works for this, but layered rendering may be low-hanging fruit that can be done in the meantime.

Anyway, onto the problem at hand...

In order to do this, I need to bind a layered depth texture as a render target. When I looked into doing this in OSG, the two threads I found claimed it wasn't possible yet, but as they were from a long time ago, it's possible support has been implemented since them. Can this be done yet? I'd rather not have to spend a long time investigating only to determine that it's still impossible.

Thank you!

Cheers,
Chris
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12337

PostPosted: Wed May 15, 2019 7:54 am    Post subject:
Layered rendering with a geometry shader
Reply with quote

Hi Chris,

On Wed, 15 May 2019 at 00:32, Chris Djali <> wrote:
Quote:
I'm investigating using a geometry shader to render multiple shadow map cascades in one pass in OpenMW. While I've heard conflicting (but mostly negative) accounts of how much additional performance this can bring, I reckon it's likely to help, as OpenMW uses a ridiculous quantity of tiny drawables, causing a ridiculous number of draw calls when RTT passes are used, and there's no easy batching implementation as user/game scripts can add, remove, replace and relocate object with no notice. There are solutions in the works for this, but layered rendering may be low-hanging fruit that can be done in the meantime.

Both OpenGL and OSG suffer from lots of small grained drawables. so
avoiding lots of drawables can be crucial to improving performance.
This may be resolvable at the high level in your application with
exsiting OSG features, or tackled by subclass from vsg::Drawable or
vsg::Geometry to provide a custom drawImplementation() that is able to
juggle the dynamic changes in a more lightweight way. For instance if
you can keep the vertex arrays pretty constant but add/remove
PrimitiveSet in a dynamic way then should be avoid much of the cost of
the alternative of lots separate drawables.

Quote:
Anyway, onto the problem at hand...

In order to do this, I need to bind a layered depth texture as a render target. When I looked into doing this in OSG, the two threads I found claimed it wasn't possible yet, but as they were from a long time ago, it's possible support has been implemented since them. Can this be done yet? I'd rather not have to spend a long time investigating only to determine that it's still impossible.

I don't know enough of what you are thinking of to be able to make any
suggestions here, it's too open ended.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Voerman, L.
Guest





PostPosted: Wed May 15, 2019 8:09 am    Post subject:
Layered rendering with a geometry shader
Reply with quote

Hi Chris,I did something similar a using multiple viewports, and created the osgshadermultiviewport example to preserve some of the work I did.
It might be dependent on nvidia hardware (the extention strings suggest so). 
I do remember some discussion about layered framebuffer attachments, but don't remember if it's been resolved.
I suppose it would be useful to try to port the example from multiviewport to multilayer - this might also change the range of hardware that can be used - 
and can be used to see if the multilayer (depth) buffer works .
Laurens.


On Wed, May 15, 2019 at 1:25 AM Chris Djali < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi,

I'm investigating using a geometry shader to render multiple shadow map cascades in one pass in OpenMW. While I've heard conflicting (but mostly negative) accounts of how much additional performance this can bring, I reckon it's likely to help, as OpenMW uses a ridiculous quantity of tiny drawables, causing a ridiculous number of draw calls when RTT passes are used, and there's no easy batching implementation as user/game scripts can add, remove, replace and relocate object with no notice. There are solutions in the works for this, but layered rendering may be low-hanging fruit that can be done in the meantime.

Anyway, onto the problem at hand...

In order to do this, I need to bind a layered depth texture as a render target. When I looked into doing this in OSG, the two threads I found claimed it wasn't possible yet, but as they were from a long time ago, it's possible support has been implemented since them. Can this be done yet? I'd rather not have to spend a long time investigating only to determine that it's still impossible.

Thank you!

Cheers,
Chris

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





_______________________________________________
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
Wojtek
User


Joined: 02 Nov 2011
Posts: 91

PostPosted: Wed May 15, 2019 8:24 am    Post subject:
Layered rendering with a geometry shader
Reply with quote

Hi Chris,
This is the idea I wanted to try myself some day but the day for this never came. I probably would attempt the method described here https://stackoverflow.com/questions/25058627/is-it-possible-to-render-an-object-from-multiple-views-in-a-single-pass (see answer with 4 likes).


Cheers,
Wojtek Lewandowski





śr., 15 maj 2019 o 01:42 Chris Djali < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> napisał(a):

Quote:
Hi,

I'm investigating using a geometry shader to render multiple shadow map cascades in one pass in OpenMW. While I've heard conflicting (but mostly negative) accounts of how much additional performance this can bring, I reckon it's likely to help, as OpenMW uses a ridiculous quantity of tiny drawables, causing a ridiculous number of draw calls when RTT passes are used, and there's no easy batching implementation as user/game scripts can add, remove, replace and relocate object with no notice. There are solutions in the works for this, but layered rendering may be low-hanging fruit that can be done in the meantime.

Anyway, onto the problem at hand...

In order to do this, I need to bind a layered depth texture as a render target. When I looked into doing this in OSG, the two threads I found claimed it wasn't possible yet, but as they were from a long time ago, it's possible support has been implemented since them. Can this be done yet? I'd rather not have to spend a long time investigating only to determine that it's still impossible.

Thank you!

Cheers,
Chris

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





_______________________________________________
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
AnyOldName3 (Chris Djali)
User


Joined: 08 Sep 2017
Posts: 57

PostPosted: Wed May 15, 2019 3:54 pm    Post subject:
Reply with quote

Thanks Voerman. I'd looked through the examples for other things, but not for multiple viewports, so missed that. It seems to be a good starting point once I switched the GLSL extension from the NV variant to the ARB one. Despite not being core until OpenGL 4.1, it looks like multiple viewports are available on nearly all hardware supporting geometry shaders, so I don't think I'm even going to have to worry about not supporting as much hardware as I wanted to.

Regarding more conventional batching, we have to deal with stupid assets, such as crates implemented as six individual faces each with their own texture. We don't have the rights to fix and redistribute these assets, so any possible solution is going to need stuff like texture atlassing on load. We've got a high-level outline for something that should work, but there are a lot of moving parts to meddle with, so it's beign put off for now.

Cheers,
Chris
Back to top
View user's profile Send private message
AnyOldName3 (Chris Djali)
User


Joined: 08 Sep 2017
Posts: 57

PostPosted: Mon May 20, 2019 9:17 pm    Post subject:
Reply with quote

Hi,

I've been playing around with this, and have an annoying issue. On my machine, which runs Windows and has a Radeon Vega 56, using three viewports with geometry shader instancing makes some triangles go missing in the second and third viewports. This happens in my own application and in a slightly modified version of the example. It works fine if I do everything in a single invocation, or run it on another machine, though, so I'm guessing it's a driver bug. I'd report it, but I've not found a place where AMD accepts issue reports in the form of a minimal executable reproducing the issue rather than a description of the bug and the name of the software it happens with. Does anyone have a link or contact at AMD so I can report this properly?

Cheers,
Chris
Back to top
View user's profile Send private message
Steal
User


Joined: 26 Jan 2017
Posts: 80

PostPosted: Wed May 22, 2019 8:06 am    Post subject:
Reply with quote

Ohmagawd,

I have no idea what you guys are talking about, but...

You're from the OpenMW team? I'm in love with Morrowind and played the TES3MP fork recently. I'm currently building a Skyrim clone in OSG.

https://www.youtube.com/watch?v=DN_G0YQd7qE
https://github.com/otse/MESSIAH/blob/master/src/nof/mesh.cc

Thank you!

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





PostPosted: Wed May 22, 2019 8:21 am    Post subject:
Layered rendering with a geometry shader
Reply with quote

Hi Chris,I work almost exclusively with nvidia hardware, but I remember having a similar problem, that turned out to be related to using triangle strips.
Maybe you can work around by pushing the geometry trough the optimizer to break triangle strips into triangles?
Laurens.


On Mon, May 20, 2019 at 11:18 PM Chris Djali < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi,

I've been playing around with this, and have an annoying issue. On my machine, which runs Windows and has a Radeon Vega 56, using three viewports with geometry shader instancing makes some triangles go missing in the second and third viewports. This happens in my own application and in a slightly modified version of the example. It works fine if I do everything in a single invocation, or run it on another machine, though, so I'm guessing it's a driver bug. I'd report it, but I've not found a place where AMD accepts issue reports in the form of a minimal executable reproducing the issue rather than a description of the bug and the name of the software it happens with. Does anyone have a link or contact at AMD so I can report this properly?

Cheers,
Chris

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





_______________________________________________
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
AnyOldName3 (Chris Djali)
User


Joined: 08 Sep 2017
Posts: 57

PostPosted: Wed May 22, 2019 4:50 pm    Post subject:
Reply with quote

Hi,

Most of my testing was with a ShapeDrawable with a sphere, and that uses quad strips. However, I've also tried it with some of OSG's test models, such as spaceship.osgt, and that specific example only uses triangles and is broken, too.

Cheers,
Chris
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 Geometry Shininess and Color Array ehensens General 1 Fri Sep 13, 2019 6:28 pm View latest post
No new posts [OSG 3.6.3 Core Profile GL 3+] Weird ... johansson_gbg General 0 Thu Sep 12, 2019 1:17 pm View latest post
No new posts Ability to apply StateAttributeAndMod... Blanky General [forum] 0 Wed Aug 07, 2019 3:08 pm View latest post
No new posts two pass rendering without enhancing ... Trajce Nikolov NICK General 2 Tue Jul 02, 2019 9:58 am View latest post
No new posts Force OSG for GLES 2.0 to reenable ve... plamen_t General 4 Tue Jun 11, 2019 11:57 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