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: 7791
- Joined: Tue Jan 07, 2014 11:10 am
- Contact:
Re: shadows in the freecad viewport
How to handle the *.iv file from yorik in his first post?
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: shadows in the freecad viewport
You can open it Menu File -> open ...freecad-heini-1 wrote: ↑Sun Jan 07, 2018 11:51 am How to handle the *.iv file from yorik in his first post?
but it does not work for me,
there is no ShadowGroup support in the pivy so the file does not have an effekt.
I will look how to get this ShadowGroup running
here is another iv file with a bit more action
Code: Select all
#Inventor V2.1 ascii
# to get some lighting when headlight is turned off in the viewer
DirectionalLight { direction 0 0 -1 intensity 0.2 }
ShadowGroup {
quality 1 # to get per pixel lighting
# ShadowStyle { style NO_SHADOWING }
SpotLight {
location -8 -8 8.0
direction 1 1 -1
cutOffAngle 0.35
dropOffRate 0.7
}
ShadowStyle { style SHADOWED }
Separator {
Complexity { value 1.0 }
Material { diffuseColor 1 1 0 specularColor 1 1 1 shininess 0.9 }
Shuttle { translation0 -3 1 0 translation1 3 -5 0 speed 0.25 on TRUE }
Translation { translation -5 0 2 }
Sphere { radius 2.0 }
}
Separator {
Material { diffuseColor 1 0 0 specularColor 1 1 1 shininess 0.9 }
Shuttle { translation0 0 -5 0 translation1 0 5 0 speed 0.15 on TRUE }
Translation { translation 0 0 3 }
Cube { depth 1.8 }
}
Separator {
Material { diffuseColor 0 1 0 specularColor 1 1 1 shininess 0.9 }
Shuttle { translation0 -5 0 0 translation1 5 0 0 speed 0.3 on TRUE }
Translation { translation 0 0 -3 }
Cube { }
}
ShadowStyle { style SHADOWED }
Coordinate3 { point [ -10 -10 -3, 10 -10 -3, 10 10 -3, -10 10 -3 ] }
Material { specularColor 1 1 1 shininess 0.9 }
Complexity { textureQuality 0.1 }
Texture2 { image 2 2 3 0xffffff 0x225588 0x225588 0xffffff }
Texture2Transform { scaleFactor 4 4 }
FaceSet { numVertices 4 }
}
-
- Veteran
- Posts: 7791
- Joined: Tue Jan 07, 2014 11:10 am
- Contact:
Re: shadows in the freecad viewport
No success. I copy your code into a file and named it thomas.ivmicroelly2 wrote: ↑Sun Jan 07, 2018 11:56 amYou can open it Menu File -> open ...freecad-heini-1 wrote: ↑Sun Jan 07, 2018 11:51 am How to handle the *.iv file from yorik in his first post?
but it does not work for me,
there is no ShadowGroup support in the pivy so the file does not have an effekt.
I will look how to get this ShadowGroup running
here is another iv file with a bit more actionCode: Select all
#Inventor V2.1 ascii # to get some lighting when headlight is turned off in the viewer DirectionalLight { direction 0 0 -1 intensity 0.2 } ShadowGroup { quality 1 # to get per pixel lighting # ShadowStyle { style NO_SHADOWING } SpotLight { location -8 -8 8.0 direction 1 1 -1 cutOffAngle 0.35 dropOffRate 0.7 } ShadowStyle { style SHADOWED } Separator { Complexity { value 1.0 } Material { diffuseColor 1 1 0 specularColor 1 1 1 shininess 0.9 } Shuttle { translation0 -3 1 0 translation1 3 -5 0 speed 0.25 on TRUE } Translation { translation -5 0 2 } Sphere { radius 2.0 } } Separator { Material { diffuseColor 1 0 0 specularColor 1 1 1 shininess 0.9 } Shuttle { translation0 0 -5 0 translation1 0 5 0 speed 0.15 on TRUE } Translation { translation 0 0 3 } Cube { depth 1.8 } } Separator { Material { diffuseColor 0 1 0 specularColor 1 1 1 shininess 0.9 } Shuttle { translation0 -5 0 0 translation1 5 0 0 speed 0.3 on TRUE } Translation { translation 0 0 -3 } Cube { } } ShadowStyle { style SHADOWED } Coordinate3 { point [ -10 -10 -3, 10 -10 -3, 10 10 -3, -10 10 -3 ] } Material { specularColor 1 1 1 shininess 0.9 } Complexity { textureQuality 0.1 } Texture2 { image 2 2 3 0xffffff 0x225588 0x225588 0xffffff } Texture2Transform { scaleFactor 4 4 } FaceSet { numVertices 4 } }
If I open it, there is nothing, but if I open the *.iv from yorik there is a plane and a light reflecting on it.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: shadows in the freecad viewport
here as a file
yoriks files shows a plane and a reflexion of course but the shadow does not work.Re: shadows in the freecad viewport
Note that loading the iv file from the FreeCAD File menu doesn't make use of pivy.
My computer has two GPUs, the one that is bundled inside the i7 processor and an nvidia GPU. If I run FreeCAD on the i7 GPU (using mesa drivers on linux), the shadows don't appear. If I use the nvidia GPU instead (with the proprietary driver), then the shadows are there. So the problem is probably between Coin and the OpenGL support that the driver offers...
My computer has two GPUs, the one that is bundled inside the i7 processor and an nvidia GPU. If I run FreeCAD on the i7 GPU (using mesa drivers on linux), the shadows don't appear. If I use the nvidia GPU instead (with the proprietary driver), then the shadows are there. So the problem is probably between Coin and the OpenGL support that the driver offers...
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: shadows in the freecad viewport
hello Yorik, which coin do you use?
OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12920 (Git)
Build type: None
Branch: master
Hash: 8faa9f38bb70a598afc2bc39ea1645d416ab057e
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: German/Germany (de_DE)
>>>
>>> from pivy import coin
>>> coin
<module 'pivy.coin' from '/usr/lib/python2.7/dist-packages/pivy/coin.pyc'>
>>>
>>> coin.SoSpotLight
<class 'pivy.coin.SoSpotLight'>
>>> coin.SoShadowStyle
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'SoShadowStyle'
>>> coin.COIN_MAJOR_VERSION
4
>>> coin.COIN_MICRO_VERSION
0
>>> coin.COIN_MINOR_VERSION
0
Re: shadows in the freecad viewport
Same version...
OS: Debian GNU/Linux testing (buster)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12930 (Git)
Build type: Unknown
Branch: master
Hash: 50c280fdb69f03c79b35a5202972c2f74028a627
Python version: 2.7.14+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0.beta
Locale: English/UnitedKingdom (en_GB)
OS: Debian GNU/Linux testing (buster)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.12930 (Git)
Build type: Unknown
Branch: master
Hash: 50c280fdb69f03c79b35a5202972c2f74028a627
Python version: 2.7.14+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0.beta
Locale: English/UnitedKingdom (en_GB)
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: shadows in the freecad viewport
So I really need other hardware to get shadows.
For the moment this is my way to get light and darkness
there are some light nodes and lets see what other open inventor effects can be put into this tool.
For the moment this is my way to get light and darkness
there are some light nodes and lets see what other open inventor effects can be put into this tool.
Re: shadows in the freecad viewport
is that available in coin? maybe we can add some bindings with pivy.SoShadowStyle
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: shadows in the freecad viewport
what source base of coin we use
here it is
https://github.com/Alexpux/Coin3D/blob/ ... wStyle.cpp
but to get shadows special hardware is required.
I will not devolop something for special hardware becausemostusershave default computers.