Modeling
About Archicad's design tools, element connections, modeling concepts, etc.

Casting shadows with open GL

Tom Krowka
Enthusiast
Can I set up AC to cast shadows on a model using a VR object. Using Open GL engine, VQTR2.0 engine. All the choices are greyed out.
Tom Krowka Architect
Windows 11, AC Version 26
Thomas@wkarchwk.com
www.walshkrowka.com
17 REPLIES 17
David Collins
Advocate
Ralph wrote:
Standard OpenGL doesn't calculate cast shadows.
Isn't Sketchup casting shadows in Open GL ?
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
Ralph Wessel
Mentor
David wrote:
Isn't Sketchup casting shadows in Open GL ?
Many products display cast shadows with OpenGL, but OpenGL doesn't calculate the shadows for them. There are plenty of other effects seen in games using OpenGL which are done in the same way - the different effects are calculated and layered onto surfaces for OpenGL to display.

Graphisoft could add shadows calculations to the OpenGL display if they wished to (obviously they do this in other view types), but it might have a significant impact on performance. I think the beauty of the OpenGL view is that it provides an excellent trade-off between the quality of the rendering and speed.
Ralph Wessel BArch
Software Engineer Speckle Systems
stefan
Advisor
Technically, shadows can be calculated realtime, as it is done in many modern games these days. They often use pixel- & vertex-shader-technology for this and it is available in both Direct3D & OpenGL. The technical details are more or less the same between the two.

The problem (probably): another rewrite of the viewport display (unlikely) and all these shading-language tools are rather complex. I, for one, know only about SketchUp and some games that do it. I foresee that it'll happen sooner or later, but most 3d-animation software doesn't do it yet and these applications are rather up-to-date with supporting technological advances. They all added (realtime)-shader support in the viewports allready (which is logical when you are developing content for games). And they have very complex material models as well: maps, procedural textures, shader trees. We only have a color, a few sliders and one (only one) texture with one possible alpha-channel. Dwight can do nice things with it but that's about as far as it gets.

Maybe it's easier in a smaller application like SketchUp.

Another problem is polygon counts: the amount of geometry in a full ArchiCAD model is enormous (think of trees, furniture etc...).

---

Another approach is precalculation and making textures from it (aka Lightmaps). This is done in 3D-animation software (3ds max, Lightwave, Maya & XSI). I don't expect it'll be easy in ArchiCAD, because of the limited material model. The best result are when you are allowed to layer two materials over eachother: one low resolution image with the actual material (e.g. a 300x400 brick picture) and one high resolution image with the lightmap (e.g. 2000x2000 grayscale). Why hires? Each pixel in the final image can only correspond to only one spot in the model. You can't repeat a texture over an object like you do with regular texture maps, since the lighting doesn't repeat.
--- stefan boeykens --- bim-expert-architect-engineer-musician ---
Archicad28/Revit2024/Rhino8/Solibri/Zoom
MBP2023:14"M2MAX/Sequoia+Win11
Archicad-user since 1998
my Archicad Book
Ralph Wessel
Mentor
stefan wrote:
Another problem is polygon counts: the amount of geometry in a full ArchiCAD model is enormous (think of trees, furniture etc...).
I think you have essentially hit the nail on the head there. ArchiCAD does generate a lot of surfaces. There is also a trade-off between flexibility and speed. Many games rely on quite extreme optimisation and corner-cutting to achieve real-time results, but a CAD system is fundamentally dynamic. Users can't be expected understand the cost of their modelling techniques either. Expect more in future as machines steadily get faster though...
Ralph Wessel BArch
Software Engineer Speckle Systems
aahatimo
Newcomer
what is the eaiest / fastest way to generate ext elevations w/ shadows presently?
tim hanagan
aaha! design studio durango, co
27" retina 5k iMac 4ghz i7 os 10.13.6 m395x 4 mb, 32gb ram, 512 gb ssd ac 22 current
15" retina mbp 2.6ghz 1mb 16gb ac 22 current[/size]
Djordje
Virtuoso
aahatimo wrote:
what is the eaiest / fastest way to generate ext elevations w/ shadows presently?
If you want it live and updateable, enabling the shadows in the S/E window. BUT - make a layer combo where everything that is not seen is off, and use it only for publishing/linking.

You can also make snapshots of the 3D window, in the Analytic mode, but the fastest way is, believe it or not, rendering.
Djordje



ArchiCAD since 4.55 ... 1995
HP Omen
David Collins
Advocate
Ralph wrote:
Many products display cast shadows with OpenGL, but OpenGL doesn't calculate the shadows for them.
Makes sense. Even video games have a optional toggle off for shadows, now that I think about it. Still, it would be nice to have as an option when the polygon count was amenable.

Perhaps a bit higher on the wish list would be multiple light sources. Right now you can set the sun so that your space looks nice and sunny, but turn around and suddenly you're in Castle Dracula.

Even so, I agree with Djordje that nothing beats a full screen openGL walkthrough for interactive client presentations.
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
Anonymous
Not applicable
Maybe its a bit off the subject of shadow casting but in terms of interactive client presentations I found that they go mad for VR objects.
Its a really great way to let your client feel involved in the project when they can spin and flip their building around themselves.