shadows in the freecad viewport

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: shadows in the freecad viewport

Post by Kunda1 »

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

Need to find the link
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: shadows in the freecad viewport

Post by saso »

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: 4
Joined: Wed Sep 23, 2020 7:48 am

Re: shadows in the freecad viewport

Post by aang89 »

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!
User avatar
obelisk79
Veteran
Posts: 1090
Joined: Thu Sep 24, 2020 9:01 pm

Re: shadows in the freecad viewport

Post by obelisk79 »

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
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: shadows in the freecad viewport

Post by realthunder »

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 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
User avatar
obelisk79
Veteran
Posts: 1090
Joined: Thu Sep 24, 2020 9:01 pm

Re: shadows in the freecad viewport

Post by obelisk79 »

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: 20
Joined: Sat Jun 27, 2020 6:20 pm

Re: shadows in the freecad viewport

Post by koin3D »

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
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: shadows in the freecad viewport

Post by realthunder »

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 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: 20
Joined: Sat Jun 27, 2020 6:20 pm

Re: shadows in the freecad viewport

Post by koin3D »

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
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: shadows in the freecad viewport

Post by realthunder »

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 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
Post Reply