Horizon and gradient background?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Horizon and gradient background?

Scalpel78
This post has NOT been accepted by the mailing list yet.
Hi,
I've got a few suggestions for background-handling in OpenSCAD, but would like your opinion on them before I add them as issues.

When you mouse around the viewport the solid background color takes away some of the 3D-feel.



In FreeCAD they use a gradient background-color.



While in Google Sketchup they use a gradient over the XY-plane, and a solid color under the XY-plane, effectively achieving a horizon feel.



In addition Google Sketchup has colored the XYZ-lines so that it's very easy to see which way you are rotated.

Wouldn't it be nice if OpenSCAD had the same functionality?
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

Bananapeel
Regarding the coloured axes it could be a good idea, although openscad has the colored rotating axes icon in the bottom left of the view.

I don't want gradient background or floor.

I think an extra (weaker) light source would help to view some models.
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

tp3
Bananapeel wrote
Regarding the coloured axes it could be a good idea, although openscad has the colored rotating axes icon in the bottom left of the view.

I don't want gradient background or floor.

I think an extra (weaker) light source would help to view some models.
I've changed the negative axes to be dotted (http://i.imgur.com/8qQO24A.png) but I'm not sure we really want to color the big axis cross too. With the different color schemes that probably will not work very well in all cases. Of cause the extreme option is to put all separately into the color scheme, but that might be a bit much for a small change...

Do you have an example where the lighting is not so good?
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

Scalpel78
This post has NOT been accepted by the mailing list yet.
Torsten, what do you think about gradient backgrounds, and the horizon background? Perhaps those could be added in the theme selector?
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

Bananapeel
In reply to this post by tp3
I don't like the dotted lines, it'd prefer it to stay as it is. :)

Regarding lightning, in particular angles, surface faces get (basically) the same color as indent side walls. The following images show the same model, rotated differently. In the first it looks like there is plane covering the ribs:



ribs_nb=20;
ribs_area_w = 190;
ribs_area_h = 200;

linear_extrude(height=20)
for (i = [0:ribs_nb]) {
        translate([0, i*ribs_area_w/(ribs_nb)])
        square([ribs_area_h, 2.5]);
}

tp3
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

tp3
Bananapeel wrote
Regarding lightning, in particular angles, surface faces get (basically) the same color as indent side walls. The following images show the same model, rotated differently. In the first it looks like there is plane covering the ribs.
I guess that will always happen at some specific angle unless there's multiple light sources with maybe even different colored light. If someone has an idea how to improve that without making other cases worse, I could generate some example images with different lighting.
Otherwise that topic could be revisited once the OpenGL drawing code gets updated. I think using the GPU at least for the actual model display would be a nice improvement and may even open up some more opportunities.
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

MichaelAtOz
Administrator
In reply to this post by Bananapeel
Bananapeel wrote
I don't like the dotted lines, it'd prefer it to stay as it is. :)

Regarding lightning, in particular angles, surface faces get (basically) the same color as indent side walls.
I like the dotted lines.

I also get the surface face issue, but can live with it.

I'm not fussed re gradients.

I'd refer anything that does NOT compromise performance.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

Whosawhatsis
In reply to this post by tp3
I find the same-color surfaces thing annoying frequently too. The only obvious simple solution that comes to me would be to use one of those depth fog effects, where surfaces that are further back are slightly darker/lighter. I usually see used in games to limit view distance (things get washed out completely after a certain distance), but it also helps to distinguish objects at different depths in cases like this, where other cues fail.

On Sunday, November 30, 2014 at 8:27 AM, tp3 wrote:
Bananapeel wrote
Regarding lightning, in particular angles, surface faces get (basically)
the same color as indent side walls. The following images show the same
model, rotated differently. In the first it looks like there is plane
covering the ribs.

I guess that will always happen at some specific angle unless there's
multiple light sources with maybe even different colored light. If someone
has an idea how to improve that without making other cases worse, I could
generate some example images with different lighting.
Otherwise that topic could be revisited once the OpenGL drawing code gets
updated. I think using the GPU at least for the actual model display would
be a nice improvement and may even open up some more opportunities.




-----
-- Torsten
--
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

Scalpel78
This post has NOT been accepted by the mailing list yet.
In reply to this post by MichaelAtOz
I like the dotted lines.

I do think the lines should be colored as well, though. Perhaps a checkbox could be put in the Preferences->3D view called "Color XYZ lines" to turn coloring on/off, until the whole theme thing has matured.
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

QuackingPlums
In reply to this post by tp3
Where is the light source currently? Above and behind the object, shining back towards the viewpoint? Could it be that the lack of shadows (they'd all be on the hidden faces) is making it harder to visualise certain details? Would there be a significant impact on performance if the light source were moved so that shadows would be cast from behind or to the side?

I often export the F5 render to PNG for illustration purposes when I'm designing parts for people and have had feedback that the image isn't clear, and usually they're referring to some gap or lip that would otherwise be evident if there was a shadow cast across it.

I agree that this isn't a large enough problem that I'd want to sacrifice rendering performance for it, but if it is something that can be resolved by a user-customizable colour theme or lighting source then it will come in handy on occasion.

I like the dotted lines btw. Whilst I like the graduated backgrounds in other tools I'm not bothered enough to want them in OpenSCAD.
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

Whosawhatsis
The current renderer doesn't have shadows. It doesn't really have light sources either, it just makes parts of the object facing one direction darker and parts facing the opposite direction lighter. Actual shadows (where one part or feature casts a shadow onto another) would be much more complicated to render, and I imagine it would be next to impossible with OpenCSG.

On Monday, December 1, 2014 at 12:58 AM, QuackingPlums wrote:

Where is the light source currently? Above and behind the object, shining
back towards the viewpoint? Could it be that the lack of shadows (they'd all
be on the hidden faces) is making it harder to visualise certain details?
Would there be a significant impact on performance if the light source were
moved so that shadows would be cast from behind or to the side?

I often export the F5 render to PNG for illustration purposes when I'm
designing parts for people and have had feedback that the image isn't clear,
and usually they're referring to some gap or lip that would otherwise be
evident if there was a shadow cast across it.

I agree that this isn't a large enough problem that I'd want to sacrifice
rendering performance for it, but if it is something that can be resolved by
a user-customizable colour theme or lighting source then it will come in
handy on occasion.

I like the dotted lines btw. Whilst I like the graduated backgrounds in
other tools I'm not bothered enough to want them in OpenSCAD.



--
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

QuackingPlums
Ah, ok. If we are only shading faces in a single colour based on the direction of the light source then that explains why the renders show the way that they do.

In that case does this make the discussion about multiple light sources irrelevant? I know very little about OpenCSG - I just assumed that as a 3D rendering engine, certain things would be provided automagically.


Whosawhatsis wrote
The current renderer doesn't have shadows. It doesn't really have light sources either, it just makes parts of the object facing one direction darker and parts facing the opposite direction lighter. Actual shadows (where one part or feature casts a shadow onto another) would be much more complicated to render, and I imagine it would be next to impossible with OpenCSG.
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

Bananapeel
In reply to this post by Whosawhatsis
Whosawhatsis wrote
The current renderer doesn't have shadows. It doesn't really have light sources either, it just makes parts of the object facing one direction darker and parts facing the opposite direction lighter. Actual shadows (where one part or feature casts a shadow onto another) would be much more complicated to render, and I imagine it would be next to impossible with OpenCSG.
I can see why this wouldn't work with the OpenCSG preview, but with F6 it should be possible. Shadows are overkill, and definetely not necessary. I think an extra, weak light source should be able to solve this, maybe together with gradient shading of the faces.
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

tp3
In reply to this post by Whosawhatsis
Whosawhatsis wrote
The current renderer doesn't have shadows. It doesn't really have light sources either, it just makes parts of the object facing one direction darker and parts facing the opposite direction lighter.
Right, there are no shadows, but of cause there is a light source. Actually there are 2 defined in the code, but the shader seems to use only the first one (light_position0[] = {-1.0, -1.0, +1.0, 0.0}). Currently only diffuse lighting is used - which is exactly "make color lighter/darker depending on the angle to the light source" ;).

I don't know what the best short term solution is, it's possible of cause to make the light source configurable, but we probably can't easily have some GUI control for that. So it would be just a coordinate setting in preferences... not very user friendly.
Adding another light source should be easy without too much risk of breaking existing working setups.

I guess putting a lot of time into the fixed pipeline OpenGL code is not worth it. We really need to move away from that, but this will take some time as it needs quite some refactoring (also I think for compatibility we need to support both old and new style rendering for some time). I'm currently slowly learning how to use modern OpenGL (using a simple STL / Mesh viewer https://www.flickr.com/photos/96851846@N05/sets/72157648409131261/). If nobody fancies to dig into that topic, I'll probably have a go at this. But that's certainly nothing for the next release :-).
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Horizon and gradient background?

Florian Kirsch
In reply to this post by Bananapeel
>> The current renderer doesn't have shadows. It doesn't really have light
>> sources either, it just makes parts of the object facing one direction
>> darker and parts facing the opposite direction lighter. Actual shadows
>> (where one part or feature casts a shadow onto another) would be much more
>> complicated to render, and I imagine it would be next to impossible with
>> OpenCSG.
>
>I can see why this wouldn't work with the OpenCSG preview, but with F6 it
>should be possible. Shadows are overkill, and definetely not necessary. I
>think an extra, weak light source should be able to solve this, maybe
>together with gradient shading of the faces.

Actually there is no real problem when integrating the usual shadow mapping algorithm with OpenCSG.

Florian Kirsch
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566