shadows in the freecad viewport

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
Kunda1
Posts: 8405
Joined: Thu Jan 05, 2017 9:03 pm

Re: shadows in the freecad viewport

Postby Kunda1 » Thu Sep 24, 2020 12:25 pm

What about the ladybug solar analysis integration that yorik implemented recently (that deprecated pysolar)

Need to find the link
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
saso
Posts: 1564
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: shadows in the freecad viewport

Postby saso » Thu Sep 24, 2020 12:40 pm

aang89 wrote:
Wed Sep 23, 2020 7:56 am
Given a surface, is there a way to measure the ratio of shadowed areas vs the lighted up areas on that surface?
User microelly2 created a script that can possibly do this for you, basically it calculates the shadows and creates real geometry for it, from which you can then get the area... Here is a link to the discussion https://forum.freecadweb.org/viewtopic. ... ow#p146408 and the link to his website with the script and an example model http://freecadbuch.de/doku.php?id=blog: ... bbildungen

The script can probably get improved but I guess the basic concept should be ok, here is something similar done in creo https://www.youtube.com/watch?v=oppjLDoToa4
aang89
Posts: 3
Joined: Wed Sep 23, 2020 7:48 am

Re: shadows in the freecad viewport

Postby aang89 » Fri Sep 25, 2020 12:00 am

Thanks Kunda1 and saso!

saso wrote:
Thu Sep 24, 2020 12:40 pm
aang89 wrote:
Wed Sep 23, 2020 7:56 am
Given a surface, is there a way to measure the ratio of shadowed areas vs the lighted up areas on that surface?
User microelly2 created a script that can possibly do this for you, basically it calculates the shadows and creates real geometry for it, from which you can then get the area... Here is a link to the discussion https://forum.freecadweb.org/viewtopic. ... ow#p146408 and the link to his website with the script and an example model http://freecadbuch.de/doku.php?id=blog: ... bbildungen

The script can probably get improved but I guess the basic concept should be ok, here is something similar done in creo https://www.youtube.com/watch?v=oppjLDoToa4
This is quite similar to what I'm looking for. I'll have a look at these scripts. Thanks for all the help again!
obelisk79
Posts: 18
Joined: Thu Sep 24, 2020 9:01 pm

Re: shadows in the freecad viewport

Postby obelisk79 » Tue Sep 29, 2020 2:27 am

Was very excited (I know, its 'just' eye candy, but still) to try out the shadow shading.

I'm using the realthunder fork: https://github.com/realthunder/FreeCAD/tree/LinkMerge/

I don't have any shadows when I enable them from the pulldown icon.

Image

Am I missing some kind of parameter to set in order for them to work properly?

I'm using an AMD R7950 video card if that makes a difference.
realthunder
Posts: 1750
Joined: Tue Jan 03, 2017 10:55 am

Re: shadows in the freecad viewport

Postby realthunder » Tue Sep 29, 2020 3:28 am

obelisk79 wrote:
Tue Sep 29, 2020 2:27 am
I'm using an AMD R7950 video card if that makes a difference.
Are you using Windows? Maybe you can try some fix proposed here.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
obelisk79
Posts: 18
Joined: Thu Sep 24, 2020 9:01 pm

Re: shadows in the freecad viewport

Postby obelisk79 » Tue Sep 29, 2020 3:41 am

Thanks, but I've already tried that without any luck. Maybe I need to make the jump to nvidia if I want the fancy graphics.
koin3D
Posts: 15
Joined: Sat Jun 27, 2020 6:20 pm

Re: shadows in the freecad viewport

Postby koin3D » Wed Sep 30, 2020 10:06 pm

obelisk79 wrote:
Tue Sep 29, 2020 3:41 am
Thanks, but I've already tried that without any luck. Maybe I need to make the jump to nvidia if I want the fancy graphics.
Also using an AMD graphic card.

- Did a test, using glintercept NO_ERROR edition :

https://github.com/YvesBoyadjian/glinte ... ag/1.3.5.5

- With last version of realthunder FreeCAD compiled today, I have an error message in the console :

23:42:00 Coin info in SoGLSLShaderObject::printInfoLog(): GLSLfragmentShader log: 'Fragment shader failed to compile with the following errors:
ERROR: 0:67: error(#143) Undeclared identifier: DirectionalLight
ERROR: 0:67: error(#202) No matching overloaded function found: DirectionalLight
ERROR: error(#273) 2 compilation errors. No code generated

- And, effectively, if I also copy "gliConfig.ini" in the exe directory, I have logs and shaders dump, that shows that the "DirectionalLight" method is missing in the fragment shader.

@realthunder :

- In SoShadowGroupP::setFragmentShader(), there must be a missing call to

"gen.addNamedFunction(SbName("lights/DirectionalLight"), FALSE);"
realthunder
Posts: 1750
Joined: Tue Jan 03, 2017 10:55 am

Re: shadows in the freecad viewport

Postby realthunder » Fri Oct 02, 2020 12:24 am

koin3D wrote:
Wed Sep 30, 2020 10:06 pm
@realthunder :

- In SoShadowGroupP::setFragmentShader(), there must be a missing call to

"gen.addNamedFunction(SbName("lights/DirectionalLight"), FALSE);"
It's work on my laptop. Are you using the upstream Coin3D or my fork?
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
koin3D
Posts: 15
Joined: Sat Jun 27, 2020 6:20 pm

Re: shadows in the freecad viewport

Postby koin3D » Fri Oct 02, 2020 7:27 am

realthunder wrote:
Fri Oct 02, 2020 12:24 am
koin3D wrote:
Wed Sep 30, 2020 10:06 pm
@realthunder :

- In SoShadowGroupP::setFragmentShader(), there must be a missing call to

"gen.addNamedFunction(SbName("lights/DirectionalLight"), FALSE);"
It's work on my laptop. Are you using the upstream Coin3D or my fork?
I have used the link provided by obelisk79 :
https://github.com/realthunder/FreeCAD/tree/LinkMerge/
Downloaded the sources, and done a full compilation, in debug mode
realthunder
Posts: 1750
Joined: Tue Jan 03, 2017 10:55 am

Re: shadows in the freecad viewport

Postby realthunder » Fri Oct 02, 2020 9:28 am

koin3D wrote:
Fri Oct 02, 2020 7:27 am
I have used the link provided by obelisk79 :
https://github.com/realthunder/FreeCAD/tree/LinkMerge/
Downloaded the sources, and done a full compilation, in debug mode
But the shader error is reported from within libCoin. It should work with my fork of coin.
Try Assembly3 (latest version 0.11) along with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal