There's nothing magical about sunlight that will enable you to block it while letting in other light from the same direction. And light from the sun could reach the window at a wide range of different directions.
(If you somehow contrive to have the sun always in the same direction -- say you're in a spaceship and it keeps a consistent orientation relative to the sun -- then this kind of thing could work. Not so feasible here on earth, though.)
*SUN*
++--++--++--++--++ layer 1--++--++--++--++-- layer 2
layer 1 polarizes all light in the '+' direction or the '-' direction. layer 2 does the same, but is the inverse of layer 1.
Notice that ambient light can pass through at an angle because the light didn't pass through both polarization directions. I think jws is saying 25% of ambient light passes through because the polarization step takes 50%, but half the ambient directions are blocked off completely (say by the moire patterns) so that makes 25% of ambient light.
when you look outside the window, any sunlight that enters your eyes from the angle of the sun is the sun because the sun is so far away. this is why we have well defined shadows.
any light that comes at an angle is all the light that did not come directly from the sun. light coming at an angle is directly aimed at your pupils if you're looking at the source.
what you said, the only way it's true, is if you're always looking directly at the sun.
So do these conceptual glasses have a way to find the direction of the sun, and adjust the moire patterns in real time? Based on the description, it sounded like it would always block rays normal to the plane of the lens, while allowing rays to pass through at any other angle. Rays from the sun will only rarely be normal to the lens, and so they will only rarely be blocked, without an active adjustment to change the "rejection angle." Short of that, I don't follow how the glasses can "tell" sunlight from ambient light, and I don't think it can be done without active logic.
The first sheet is polarized at 0 degrees and the second sheet is polarized at 90. When both sheets are on the window is black. When you draw a certain tiled pattern on the two sheets though, I hypothesize that you can mostly block the sun from any angle and let most of the ambient light in.
The only way I know how to solve this problem is w/ evolutionary algorithms, which might be well suited. I think someone here might have some mathematical insight into this though, so I'm putting it out there.
-- update --
OK so we need four sheets of LCDs, with each of the window layers having 2 LCD sheets each. Any light that goes through either layer is filtered with some pattern of 0' or 90' pixels.
Any random pattern, as long as the two layers have inverted pixels, will block the sun completely. Ambient light is allowed in at 50% brightness. So there you go.