Well, just think of the ground as a normal face of any other object. When you change the camera position, the shading of the face changes. When the ground shade is lightened, so is the shadow on it. The reason you see the shadow 'disappear' when you have a transparent ground is because I clamped the shadow color to the ground diffuse color, otherwise you'll see a shadow that is lighter than the background, which would be very odd. So, if you do not want the shadow 'disappear' when using a transparent ground, set the ground color to be darker than the background.pablogil wrote: ↑Mon May 25, 2020 7:38 am I think I have a new clue about this issue: the shadow is behaving as a normal "shaded face", it means it will be shaded depending on the position of light and view. The casted shadow, at least when displayed with the ground disabled, should behave as a "shadeless face". Could this be done?
Cheers
shadows in the freecad viewport
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: shadows in the freecad viewport
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: shadows in the freecad viewport
That's unexpected. I expect the opposite. There's probably something wrong with the caching. I'll look into it when I got time.OficineRobotica wrote: ↑Mon May 25, 2020 10:12 am At least on that model I get a big performance difference in frame rate between regular and spotlight. Usually the spotlight is 10x faster than regular light. I get around 3 to 10 fps when navigating the 3d viewport when using the regular light whereas I get a minimum of 30fps with the spotlight on the same scene and same machine . For my usual modeling(mechanical) I prefer the spotlight but that doesn't play really well with architectural models where the regular light makes more sense.
Please check the 'Public attribute' of the Coin3D SoShadowGroup node. Some of the attribute has no effect, and some does not seem to behave as documented. I am exposing those for experimental purpose as well.Also, if you have the time, can we get a better explanation of the shadow properties like epsilon, precision, quality, and spotlight cutoff angle, spotlight dropoff rate. With some of these properties I get more of an on/off effect when modifieng the values and I can't really understand they'r use.
Re: shadows in the freecad viewport
Yes, that is what I did and it worked but, it's still a little bit annoing that the shadow changes its "lightness" depending on the user view... Couldn't you set this face as shadeless?realthunder wrote: ↑Mon May 25, 2020 2:02 pm Well, just think of the ground as a normal face of any other object. When you change the camera position, the shading of the face changes. When the ground shade is lightened, so is the shadow on it. The reason you see the shadow 'disappear' when you have a transparent ground is because I clamped the shadow color to the ground diffuse color, otherwise you'll see a shadow that is lighter than the background, which would be very odd. So, if you do not want the shadow 'disappear' when using a transparent ground, set the ground color to be darker than the background.
Thanks
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
Re: shadows in the freecad viewport
Tested with:
Works great... the effect of having both shadows and bump map is just awesome!
I noticed that shadows are not shown when:
- adding some standard Part objects (a cube)
- switch to Draft WB
- enable the Draft_Grid.
- shadow disappears.
Perhaps it's a good chance to think about a standard Gui::Grid that every workbench share... (ref https://forum.freecadweb.org/viewtopic.php?f=22&t=22296)
Edit: maybe i found it, it should be about the scale: the grid is so big compared to std Part objects! if I add a bigger object the shadow is displayed perfectly also with the grid! sorry for the noise.
Code: Select all
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20886 +2287 (Git)
Build type: Release
Branch: LinkStage3
Hash: 5f7898eae20e4e8ef3e6190ad8b354e23bbf66e7
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
Graphics card GTX 1070
I noticed that shadows are not shown when:
- adding some standard Part objects (a cube)
- switch to Draft WB
- enable the Draft_Grid.
- shadow disappears.
Perhaps it's a good chance to think about a standard Gui::Grid that every workbench share... (ref https://forum.freecadweb.org/viewtopic.php?f=22&t=22296)
Edit: maybe i found it, it should be about the scale: the grid is so big compared to std Part objects! if I add a bigger object the shadow is displayed perfectly also with the grid! sorry for the noise.
follow my experiments on BIM modelling for architecture design
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: shadows in the freecad viewport
Can you guys try the spot light with 'DropOffRate' and 'CutOffAngle' settings? Any effect? I managed to make them work on my computer but requires yet another patch to Coin3D. It seems to be crippled by some graphics driver bug in updating shader predefined variables. Not sure if it is specific to my graphics driver. I am using ubuntu with Intel integrated graphics.
Re: shadows in the freecad viewport
Works fine here with the system of the above post.realthunder wrote: ↑Tue May 26, 2020 10:05 am Can you guys try the spot light with 'DropOffRate' and 'CutOffAngle' settings?
follow my experiments on BIM modelling for architecture design
Re: shadows in the freecad viewport
It seems to work properly on the objects but it makes something strange in the shadow (when "ground transparency" is set to 1):realthunder wrote: ↑Tue May 26, 2020 10:05 am Can you guys try the spot light with 'DropOffRate' and 'CutOffAngle' settings? Any effect? I managed to make them work on my computer but requires yet another patch to Coin3D. It seems to be crippled by some graphics driver bug in updating shader predefined variables. Not sure if it is specific to my graphics driver. I am using ubuntu with Intel integrated graphics.
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
-
- Veteran
- Posts: 2190
- Joined: Tue Jan 03, 2017 10:55 am
Re: shadows in the freecad viewport
Image updated.
Fixed a few spot light settings. The cut off angle previously uses radian instead of degree. Drop off rate can now be negative, which will make the spotlight a special non attenuating 'directional spotlight'. Note that the drop off rate attenuates the light intensity with exponential rate. It appears that the initial drop is much faster comparing to later. I have changed the spin box step to 0.01.
Fixed a few spot light settings. The cut off angle previously uses radian instead of degree. Drop off rate can now be negative, which will make the spotlight a special non attenuating 'directional spotlight'. Note that the drop off rate attenuates the light intensity with exponential rate. It appears that the initial drop is much faster comparing to later. I have changed the spin box step to 0.01.
Directional light now should have the same performance as spot light. This is another coin3D problem.OficineRobotica wrote: ↑Mon May 25, 2020 10:12 am At least on that model I get a big performance difference in frame rate between regular and spotlight.
I have added a new setting 'GroundShading' for that, and can be configured in preference dialog. When disabled, the shadow will have no shading. You can use the ground color to change the shadow color.pablogil wrote: ↑Mon May 25, 2020 7:38 am I think I have a new clue about this issue: the shadow is behaving as a normal "shaded face", it means it will be shaded depending on the position of light and view. The casted shadow, at least when displayed with the ground disabled, should behave as a "shadeless face". Could this be done?
- OficineRobotica
- Posts: 433
- Joined: Thu Feb 21, 2019 8:17 am
- Contact:
Re: shadows in the freecad viewport
I haven't realized previously the power of this shading mode when using freecad. When working with assemblies or other complex parts it gives a REAL visual advantage enabling me to concentrate on the workflow instead of squinting at the screen, trying to figure out where one component meets another. This is why , in my opinion, the drop shadow mode should be up high as importance for the merger in freecad trunk and a great value addition. I also think it could be a excellent tool as pr/publicity for spreading freecad in to the wild. Looking back at the history, Blender and Krita have exploded in popularity after similar visual changes that generated cool screenshots which in turn got people interested in giving a real try at using the application.realthunder wrote: ↑Tue May 26, 2020 10:54 pm Image updated.
Fixed a few spot light settings. The cut off angle previously uses radian instead of degree. Drop off rate can now be negative, which will make the spotlight a special non attenuating 'directional spotlight'. Note that the drop off rate attenuates the light intensity with exponential rate. It appears that the initial drop is much faster comparing to later. I have changed the spin box step to 0.01.
One simply got to love the shadows in the pool.
Indeed I get the same performance now on my hardware.Directional light now should have the same performance as spot light. This is another coin3D problem.
Also, I cant put my finger on what it is, but the shading of the models with the directional light now is just......better.
I find this mode to be more realistic in some cases and less distracting while having at the same time the clue of the shadow underneath the model. Thank you.I have added a new setting 'GroundShading' for that, and can be configured in preference dialog. When disabled, the shadow will have no shading. You can use the ground color to change the shadow color.
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
Re: shadows in the freecad viewport
indeed i'm already in love with the shadow in the pool!
follow my experiments on BIM modelling for architecture design