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 

Idea to implement a kind of 'rubber mode'

Goto page 1, 2  Next
 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
christoph
Newbie


Joined: 10 Jul 2014
Posts: 15

PostPosted: Tue Sep 11, 2018 11:51 am    Post subject:
Idea to implement a kind of 'rubber mode'
Reply with quote

Hi all,

I'm looking for some inspiration for solving the following 'problem':
Currently I'm drawing basic line geometries like in attachment line.png. And I'm able to draw items above the geometries (combo.png). But the final goal must be some kind of 'rubber mode' which makes the geometry transparent and keeps the background (liek in symbol.png).

What may be the technique to solve this?

Thank you!

Cheers,
Christoph
Back to top
View user's profile Send private message
Chris Hanson
Guest





PostPosted: Tue Sep 11, 2018 3:33 pm    Post subject:
Idea to implement a kind of 'rubber mode'
Reply with quote

I think there's a little bit of communication issue here. 

You are saying you want the look of symbol.jpg? How do you mean "rubber mode"? What is "rubber" about it?


You could possibly create a dummy quad with the background blue color on it that encompasses the screen-space bounding box of the green line, and render it after the black line but before the green one. Would that give you the effect you want?


On Tue, Sep 11, 2018 at 12:50 PM Christoph Dohmen < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi all,

I'm looking for some inspiration for solving the following 'problem':
Currently I'm drawing basic line geometries like in attachment line.png. And I'm able to draw items above the geometries (combo.png). But the final goal must be some kind of 'rubber mode' which makes the geometry transparent and keeps the background (liek in symbol.png).

What may be the technique to solve this?

Thank you!

Cheers,
Christoph

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



_______________________________________________
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



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
christoph
Newbie


Joined: 10 Jul 2014
Posts: 15

PostPosted: Tue Sep 11, 2018 5:09 pm    Post subject:
Reply with quote

Well, Chris, thanks for the question. It shows that I was not precise enough.
Currently I'm drawing the black line on top of a quite complex background (light blue). And as a second item I draw the quad with the red frame showing the green symbol and having transparent colour in the background so the scene background hat visible and the black line.
My goal is to use the textured quad as a rubber and remove the black line but not the scene background like in symbol.png.

I hope that clarified it a bit more?!

Thank you!

Cheers,
Christoph
Back to top
View user's profile Send private message
Chris Hanson
Guest





PostPosted: Tue Sep 11, 2018 7:37 pm    Post subject:
Idea to implement a kind of 'rubber mode'
Reply with quote

I think some parts were lost in translation. I think the word you want to use is "eraser" instead of "rubber", though I can see how it could be mistranslated from another language.

I can think of a way to do this with your current draw order (black line then green line) by using a shader and a texture holding the background image.


Otherwise, you'd have to probably change the draw order so that the black line was drawn later than the green line.




I often recommend users with complex questions "take a step back" and explain the non-simple-abstract problem. Many times we find people asking a specific question believing it is the only solution, and finding no good ways to achieve it, when in fact the same overall goal could easily be accomplished a different way if we knew what they were really trying to do.


Could you explain more about the real-world problem you're trying to solve, instead of this simplified abstract summary?


As an example, imagine if someone came to you asking how to safely operate a flamethrower in their kitchen, and you answered it was impossible. Later you found out that all they wanted to do was make tea, but had pre-decided on "flamethrower" as the way to get there, but if they'd just said "I want to make tea", an electric kettle would have neatly solved the problem. Don't be the flamethrower tea guy.






On Tue, Sep 11, 2018 at 6:08 PM Christoph Dohmen < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Well, Chris, thanks for the question. It shows that I was not precise enough.
Currently I'm drawing the black line on top of a quite complex background (light blue). And as a second item I draw the quad with the red frame showing the green symbol and having transparent colour in the background so the scene background hat visible and the black line.
My goal is to use the textured quad as a rubber and remove the black line but not the scene background like in symbol.png.

I hope that clarified it a bit more?!

Thank you!

Cheers,
Christoph

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





_______________________________________________
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



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
minghia
Appreciator


Joined: 12 Dec 2011
Posts: 109
Location: Sydney, Australia

PostPosted: Wed Sep 12, 2018 1:32 am    Post subject:
Reply with quote

Hi Chris
Actually in non US English the words rubber and eraser are interchangeable.

Tony

_________________
Tony V
Back to top
View user's profile Send private message
christoph
Newbie


Joined: 10 Jul 2014
Posts: 15

PostPosted: Wed Sep 12, 2018 6:00 am    Post subject:
Reply with quote

Hi Chris,

the original goal is drawing a decorated line where the decoration interrupts and keep the background visible. I tried to visualize the elements and the seps which are acutally working. I got a few keywords like 'stencil', 'render to texture' but the samples are all related to textured items covering textured items and not to polylines covered by textured items.

Thank you!

Cheers,
Christoph
Back to top
View user's profile Send private message
Daniel Trstenjak
Guest





PostPosted: Wed Sep 12, 2018 7:14 am    Post subject:
Idea to implement a kind of 'rubber mode'
Reply with quote

Hi Christoph,

On Tue, Sep 11, 2018 at 07:09:26PM +0200, Christoph Dohmen wrote:
Quote:
Well, Chris, thanks for the question. It shows that I was not precise
enough. Currently I'm drawing the black line on top of a quite
complex background (light blue). And as a second item I draw the quad
with the red frame showing the green symbol and having transparent
colour in the background so the scene background hat visible and the
black line. My goal is to use the textured quad as a rubber and
remove the black line but not the scene background like in symbol.png.

are you making some kind of drawing program, and you want to be able
to move the rubber/erasier around and delete the previously drawn lines?

If this is the case, then you most likely don't want to implement the
erasing operation as an OpenGL graphics operation, but as an operation
on your program data describing the lines.

You're modifying the internal program state and then draw this new state.

Greetings,
Daniel


------------------
Post generated by Mail2Forum
Back to top
Voerman, L.
Guest





PostPosted: Wed Sep 12, 2018 9:08 am    Post subject:
Idea to implement a kind of 'rubber mode'
Reply with quote

Hi Christoph,attached is an osg file that does what I think you want,
unzip and view with:
"osgviewer cow.osg.0,-5,0.trans erasor.osg.10,10,10.scale"


The osg file works by using a low (negative) render bin number to force the draw order,
first renderbin -2 draws the erasor geometry and the outline,
than renderbin -1 renders an invisible quad (colormast all OFF)
to fill the depth buffer with 0 (depth range 0-0),
so it's pixels won't be overwritten by the normal rendering done later.

Laurens.
On Wed, Sep 12, 2018 at 7:59 AM Christoph Dohmen < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Chris,

the original goal is drawing a decorated line where the decoration interrupts and keep the background visible. I tried to visualize the elements and the seps which are acutally working. I got a few keywords like 'stencil', 'render to texture' but the samples are all related to textured items covering textured items and not to polylines covered by textured items.

Thank you!

Cheers,
Christoph

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





_______________________________________________
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
christoph
Newbie


Joined: 10 Jul 2014
Posts: 15

PostPosted: Wed Sep 12, 2018 9:10 am    Post subject:
Reply with quote

Hi Daniel,

it's not a drawing programm.

Thank you!

Cheers,
Christoph
Back to top
View user's profile Send private message
christoph
Newbie


Joined: 10 Jul 2014
Posts: 15

PostPosted: Wed Sep 12, 2018 11:51 am    Post subject:
Reply with quote

Yes, Laurens, that's exactely what I was looking for!

Do you have any source which created the file?

Thank you!

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





PostPosted: Wed Sep 12, 2018 1:32 pm    Post subject:
Idea to implement a kind of 'rubber mode'
Reply with quote

Hi Christoph,I don't have a piece of source code that will create this file, I exported the basic shapes from 3dsmax and edited the file to set the renderbins, depth and colormask. 
Laurens.


On Wed, Sep 12, 2018 at 1:50 PM Christoph Dohmen < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Yes, Laurens, that's exactely what I was looking for!

Do you have any source which created the file?

Thank you!

Cheers,
Christoph

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





_______________________________________________
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
christoph
Newbie


Joined: 10 Jul 2014
Posts: 15

PostPosted: Wed Sep 12, 2018 3:19 pm    Post subject:
Reply with quote

Thank you, Laurens!

Cheers,
Christoph
Back to top
View user's profile Send private message
Chris Hanson
Guest





PostPosted: Wed Sep 12, 2018 9:50 pm    Post subject:
Idea to implement a kind of 'rubber mode'
Reply with quote

That's a clever trick. Will it work with more than one layer of red-frame-green-symbol objects?

Does it need to work in that situation?


"Rubber" means something else in US English. Wink




On Wed, Sep 12, 2018 at 4:18 PM Christoph Dohmen < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Thank you, Laurens!

Cheers,
Christoph

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





_______________________________________________
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



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
Voerman, L.
Guest





PostPosted: Thu Sep 13, 2018 7:38 am    Post subject:
Idea to implement a kind of 'rubber mode'
Reply with quote

Hi Chris,> Will it work with more than one layer of red-frame-green-symbol objects?
I don't fully understand your question. The renderBin numbers can force the render order of lots of "layers", 
but the invisible quad fills the depth buffer with zeros - so that will not really scale with a layer system.
Laurens.


On Wed, Sep 12, 2018 at 11:49 PM Chris Hanson < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
That's a clever trick. Will it work with more than one layer of red-frame-green-symbol objects?

Does it need to work in that situation?


"Rubber" means something else in US English. Wink




On Wed, Sep 12, 2018 at 4:18 PM Christoph Dohmen < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Thank you, Laurens!

Cheers,
Christoph

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





_______________________________________________
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



--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]






_______________________________________________
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
christoph
Newbie


Joined: 10 Jul 2014
Posts: 15

PostPosted: Thu Sep 13, 2018 8:00 am    Post subject:
Reply with quote

Hi Laurens,

it's working if I reduce the current drawing sources to fixed function pipeline. But unfortunately we use several shaders. As far as I understand the idea, I will need to access the ColorMask from within the fragment shader, right? Any hints for that or am I totally wrong?

Thank you!

Cheers,
Christoph
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
Goto page 1, 2  Next
Page 1 of 2

 
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 osgEarth often crashes in multi-displ... xdfanfan General 0 Mon Nov 26, 2018 8:07 am View latest post
No new posts osgText: problem with SCREEN_COORDS mode gwaldron General 9 Thu May 17, 2018 3:56 pm View latest post
No new posts set cullface mode in osg file Meldryt General 1 Fri Mar 02, 2018 10:07 am View latest post
No new posts Idea about shadows wernerM General 1 Wed Sep 06, 2017 8:55 am View latest post
No new posts wireframe mode and degenerate triangles cbuchner1 General 1 Fri Dec 30, 2016 1:39 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