Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow GPU-based shading calculations #7302

Merged
merged 61 commits into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2f6f386
Link to Penumbra.
nealkruis Apr 2, 2019
9ad3b1f
Penumbra Cmake fixes (for Windows builds).
nealkruis Apr 2, 2019
3c8e0d4
Merge branch 'develop' into penumbra-integration
nealkruis Apr 23, 2019
2a30fc3
Initial implementation of Penumbra to do shading calculations.
nealkruis May 3, 2019
8aafc93
Fix reveal calculations.
nealkruis May 8, 2019
674d389
Update penumbra.
nealkruis May 16, 2019
f041b22
Modify ShadowCalculation object to allow input for GPU-based shading.
nealkruis May 16, 2019
341047a
Update testfiles.
nealkruis May 16, 2019
cf37de5
Merge branch 'develop' into penumbra-integration
nealkruis May 16, 2019
7794e71
Add design document.
nealkruis May 16, 2019
3030f59
Fix unit tests using 'ShadowCalculation' object.
nealkruis May 20, 2019
762b35c
Only run Penumbra tests if OpenGL is available.
nealkruis May 20, 2019
9cd3a17
Eliminate function name conflict.
nealkruis May 20, 2019
aeddb46
Update design doc.
nealkruis May 20, 2019
f3d0cab
Expand description of existing capabilities.
nealkruis May 20, 2019
6f02d69
Add Pixel Counting Resolution field.
nealkruis Jun 6, 2019
a0bd5c4
Add interior solar distribution calculations.
nealkruis Jun 13, 2019
ebca86b
Separate shader programs for render and calculate.
nealkruis Jun 13, 2019
5170ab3
Remove extra query check.
nealkruis Jun 13, 2019
5709797
Update Penumbra.
nealkruis Jun 14, 2019
0e0e847
Fix minor inconsistencies.
nealkruis Jun 14, 2019
a6e3fd4
Merge remote-tracking branch 'origin/develop' into penumbra-integration
mbadams5 Jun 27, 2019
139e522
Initial work on gpu performance and multi query
mbadams5 Jun 28, 2019
ee6073f
Fix bugs and test new performance ideas
mbadams5 Jun 30, 2019
4991f3d
Update for profiling
mbadams5 Jul 2, 2019
821ff2d
Don't set penumbra model if there are no surfaces.
nealkruis Jul 2, 2019
e0d0615
Merge branch 'develop' into multi_query
mbadams5 Jul 5, 2019
e2c55b1
Merge branch 'penumbra-integration' of github.com:NREL/EnergyPlus int…
mbadams5 Jul 5, 2019
ed39392
Allow builds without OpenGL (but issue warning).
nealkruis Jul 9, 2019
8adfa69
Merge branch 'develop' into penumbra-integration
nealkruis Jul 9, 2019
a0ea07b
Clean up cmake warning.
nealkruis Jul 11, 2019
83db34a
Merge branch 'develop' into penumbra-integration
mbadams5 Aug 12, 2019
e9db9fb
Merge remote-tracking branch 'origin/develop' into penumbra-integration
mbadams5 Oct 16, 2019
c867e0d
Code clean up
mbadams5 Oct 16, 2019
688708f
Fix infinite loop bug in penumbra unit tests
mbadams5 Dec 19, 2019
c26aee2
Merge branch 'develop' into penumbra-integration
mbadams5 Dec 19, 2019
6870012
Fix build error and initial runtime GPU check
mbadams5 Dec 22, 2019
b83c45c
Merge branch 'develop' into penumbra-integration
mbadams5 Dec 22, 2019
90da248
Add a an OpenGL on/off CMake flag
jasondegraw Dec 31, 2019
7b74c8c
Fix compile error in unit tests
mbadams5 Jan 1, 2020
522116a
Fix failing unit and performance tests
mbadams5 Jan 1, 2020
30b1023
Merge remote-tracking branch 'origin/update-license-year' into penumb…
mbadams5 Jan 2, 2020
b807e10
Clean up code and fix linux issues
mbadams5 Jan 2, 2020
72eebfb
Pass error callback to use E+ error messaging
mbadams5 Jan 3, 2020
1b398a1
Merge branch 'develop' into penumbra-integration
mbadams5 Jan 20, 2020
76b49a8
Fix two integration errors
mbadams5 Jan 21, 2020
5d01fd0
Test mac and windows CI opengl builds
mbadams5 Jan 22, 2020
94a46b2
Add GPU context check.
nealkruis Jan 27, 2020
e6b6b47
Update penumbra unit tests to not run if it can't create a valid Open…
nealkruis Feb 19, 2020
a22b1aa
Merge develop into penumbra-integration.
nealkruis Feb 19, 2020
32a411c
Clean up compiler warnings.
nealkruis Feb 20, 2020
fde9a15
Merge remote-tracking branch 'origin/develop' into penumbra-integration
mbadams5 Feb 21, 2020
353723a
Fix unit test errors since penumbra error shouldn't fatal
mbadams5 Feb 21, 2020
5e06222
Remove unused using statements
mbadams5 Feb 21, 2020
e3fc456
Add transition rules.
nealkruis Feb 21, 2020
95b2e30
Fixing failing unit test
mbadams5 Feb 21, 2020
dbf990b
Add transition rules description.
nealkruis Feb 21, 2020
742a5ec
Add output rules description.
nealkruis Feb 21, 2020
4b565c3
Fix build warning
mbadams5 Feb 21, 2020
a8518d9
Merge branch 'penumbra-integration' of https://github.com/NREL/Energy…
nealkruis Feb 21, 2020
9618585
Draft documentation.
nealkruis Feb 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .decent_ci-MacOS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ compilers:
- IFW
- TGZ
release_build_cmake_extra_flags: -DBUILD_DOCS:BOOL=ON
cmake_extra_flags: -DBUILD_FORTRAN=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=$REGRESSION_BASELINE -DREGRESSION_SCRIPT_PATH:PATH=$REGRESSION_DIR -DREGRESSION_BASELINE_SHA:STRING=$REGRESSION_BASELINE_SHA -DCOMMIT_SHA=$COMMIT_SHA -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF
cmake_extra_flags: -DBUILD_FORTRAN=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=$REGRESSION_BASELINE -DREGRESSION_SCRIPT_PATH:PATH=$REGRESSION_DIR -DREGRESSION_BASELINE_SHA:STRING=$REGRESSION_BASELINE_SHA -DCOMMIT_SHA=$COMMIT_SHA -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DOPENGL_REQUIRED:BOOL=ON
4 changes: 2 additions & 2 deletions .decent_ci-Windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ compilers:
build_package_generator:
- IFW
release_build_cmake_extra_flags: -DBUILD_DOCS:BOOL=ON -DTEX_INTERACTION="nonstopmode"
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=%REGRESSION_BASELINE% -DREGRESSION_SCRIPT_PATH:PATH=%REGRESSION_DIR% -DREGRESSION_BASELINE_SHA:STRING=%REGRESSION_BASELINE_SHA% -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=%REGRESSION_BASELINE% -DREGRESSION_SCRIPT_PATH:PATH=%REGRESSION_DIR% -DREGRESSION_BASELINE_SHA:STRING=%REGRESSION_BASELINE_SHA% -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DOPENGL_REQUIRED:BOOL=ON

- name: Visual Studio
version: 16
Expand All @@ -15,4 +15,4 @@ compilers:
- IFW
- ZIP
release_build_cmake_extra_flags: -DBUILD_DOCS:BOOL=ON -DTEX_INTERACTION="nonstopmode"
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=%REGRESSION_BASELINE% -DREGRESSION_SCRIPT_PATH:PATH=%REGRESSION_DIR% -DREGRESSION_BASELINE_SHA:STRING=%REGRESSION_BASELINE_SHA% -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF
cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=ON -DREGRESSION_BASELINE_PATH:PATH=%REGRESSION_BASELINE% -DREGRESSION_SCRIPT_PATH:PATH=%REGRESSION_DIR% -DREGRESSION_BASELINE_SHA:STRING=%REGRESSION_BASELINE_SHA% -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DOPENGL_REQUIRED:BOOL=ON
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ else()
set(GIT_DIR "")
endif()

set( OPENGL_REQUIRED OFF CACHE BOOL "Require OpenGL in order to build" )
if(OPENGL_REQUIRED)
find_package(OpenGL)
if(NOT OPENGL_FOUND)
set(CMAKE_VERSION_BUILD "${CMAKE_VERSION_BUILD} (No OpenGL)" CACHE STRING "Build number" FORCE) # git sha
message(WARNING "OpenGL libraries were not found. EnergyPlus will be compiled without GPU acceleration capabilities.")
endif()
else()
set( OPENGL_FOUND FALSE )
endif()

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
Expand Down Expand Up @@ -147,6 +158,9 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/SQLite/ SYSTEM )
INCLUDE_DIRECTORIES( "${CMAKE_SOURCE_DIR}/third_party/Expat" "${CMAKE_SOURCE_DIR}/third_party/Expat/lib" SYSTEM )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/CLI/ )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/eigen/ )
if( OPENGL_FOUND )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/penumbra/include )
endif()
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/Windows-CalcEngine/src/Chromogenics/include)
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/Windows-CalcEngine/src/Common/include)
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/Windows-CalcEngine/src/Gases/include)
Expand All @@ -162,6 +176,11 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/third_party/Windows-CalcEngine/src/View

set(RE2_BUILD_TESTING OFF CACHE BOOL "" FORCE)


if( OPENGL_FOUND )
set(BUILD_PENUMBRA_TESTING ${BUILD_TESTING} CACHE BOOL "" FORCE)
endif()

if( BUILD_TESTING )
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(BUILD_GTEST ON CACHE BOOL "" FORCE)
Expand Down Expand Up @@ -199,6 +218,10 @@ ADD_SUBDIRECTORY(third_party/btwxt)
# Kiva
INCLUDE(third_party/cmake/kiva.cmake)

if( OPENGL_FOUND )
ADD_SUBDIRECTORY(third_party/penumbra)
endif()

execute_process( COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py" "${CMAKE_SOURCE_DIR}" TIMEOUT 30 RESULT_VARIABLE generate_epJSON_schema_result)
if( ${generate_epJSON_schema_result} MATCHES ".*timeout.*" )
message(FATAL_ERROR "Generating epJSON Schema from IDD failed: ${generate_epJSON_schema_result}")
Expand Down
4 changes: 4 additions & 0 deletions cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
ADD_CXX_DEFINITIONS("-DOBJEXXFCL_ALIGN=64") # Align ObjexxFCL arrays to 64B
ADD_CXX_DEBUG_DEFINITIONS("-DOBJEXXFCL_ARRAY_INIT_DEBUG") # Initialize ObjexxFCL arrays to aid debugging

if (NOT OPENGL_FOUND)
add_definitions("-DEP_NO_OPENGL")
endif()

# Make sure expat is compiled as a static library
ADD_DEFINITIONS("-DXML_STATIC")

Expand Down
54 changes: 54 additions & 0 deletions design/FY2019/GPU-Shading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
GPU-based Shading Calculations
==============================

**Neal Kruis, Big Ladder Software, LLC**

## Justification for New Feature ##

GPU architecture is optimized for performing geometry operations. Leveraging methodologies used in the gaming industry to represent shadows, the GPU can (in theory) improve computational performance of shading calculations and provide greater flexibility (e.g., handle concave geometries and solar transmission through interior glazing).

## Approach ##

The general approach is to use the Pixel Counting methodology described by Jones et al. In this approach, the building is rendered using OpenGL. Each surface is then viewed from the (parallel projection) perspective of the sun. The number of visible pixels for that surface is a proxy for the projected sunlit surface area. Dividing by the cosign of incidence for that surface gives the total sunlit surface area.

### Exterior Shading ###

Pixel counting for exterior shading can be handled using Big Ladder's [Penumbra](https://github.com/bigladder/penumbra) library (a C++ implementation of Jones's pixel counting method).

### Interior Solar Distribution ###

We will count pixels when viewing the from the perspective of the sun through a window with each internal surface assigned a different color, then use the histogramming functions in OpenGL to report the number of pixels of each color that are visible. This functionality will be added to Penumbra.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this place a limit on the maximum number of surfaces (e.g. maximum number of colors)?

Copy link

@macumber macumber May 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will this interior calculation work with blinds and shades on windows that are controlled at each timestep? What about shading surfaces with transmittance schedules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have to check, but I think we aren't limited to the number of colors. Even still, 255x255x255 = 16,581,375. Hard to imagine there would be more surfaces in a model (let alone a single zone).

Blinds/shades will work the same as they currently do. They aren't part of the shading calculations they affect the transmittance (of the solar through the window).

Scheduled transmittance is a different challenge discussed below in the document.


### Pitfalls ###

#### Hardware requirements ####

This approach only works if there are graphics drivers (or emulators) that support OpenGL version 2.1 (or higher) on the machine running the code. This introduces a new hardware requirement for EnergyPlus. If GPU-based shading is requested and the required hardware (or emulated hardware) is not present, EnergyPlus will issue a warning and revert to the CPU-based polygon clipping method.

#### Transparent shading surfaces ####

Non-opaque shading surfaces are difficult to characterize under this approach (although, from early testing of SolarShadingTest.idf it doesn't appear to be working properly with the CPU calculations either).

There are a couple potential solutions to this problem:

1. We use the perforated approach described by Jones.
2. We introduce transparency to the OpenGL rendering and calculate the color of the pixels returned.
3. We render with and without transparent surfaces to evaluate their impact.

## Input Output Reference Documentation ##

See proposed changes in [Energy+.idd.in](https://github.com/NREL/EnergyPlus/pull/7302/files#diff-23ccf090b80d26e885712256b9a6d888). Will draft document once IDD is reviewed.

## Engineering Reference ##

Mainly a reference to Jones's papers.

## References ##

[Fast computer graphics techniques for calculating direct solar radiation on complex building surfaces](http://dx.doi.org/10.1080/19401493.2011.582154)

Nathaniel L. Jones, Donald P. Greenberg, and Kevin B. Pratt. Journal of Building Performance Simulation. Volume 5, Issue 5, Pages 300-312. June 26, 2011.

[Hardware accelerated computation of direct solar radiation through transparent shades and screens](https://nljones.github.io/publications/SB12_TS09b_3_Jones.pdf)

Nathaniel L. Jones and Donald P. Greenberg. 5th National Conference of the International Building Performance Simulation Association-USA. Madison, Wisconsin. August 1-3, 2012
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ \section{Shading Module}\label{shading-module}

\subsection{Shading and Sunlit Area Calculations}\label{shading-and-sunlit-area-calculations}

When assessing heat gains in buildings due to solar radiation, it is necessary to know how much of each part of the building is shaded and how much is in direct sunlight. As an example, the figure below shows a flat roofed, L-shaped structure with a window in each of the visible sides. The sun is to the right so that walls 1 and 3 and windows a and c are completely shaded, and wall 4 and window d are completely sunlit. Wall 2 and window b are partially shaded. The sunlit area of each surface changes as the position of the sun changes during the day. The purpose of the EnergyPlus shadow algorithm is to compute these \textbf{sunlit areas}.~ Predecessors to the EnergyPlus shadowing concepts include the BLAST and TARP shadowing algorithms.

The shadow algorithm is based on coordinate transformation methods similar to Groth and Lokmanhekim and the shadow overlap method of Walton.

Using the \textbf{ShadowCalculation} object, you can set how often the shadowing calculations are performed. Calculating them every timestep (TimestepFrequency options) is obviously the most accurate but is also be the most time consuming.~ Using a greater length of time (number of days) before calculating again can yield speedier results.~ For lengths of time greater than one day, the solar position values (e.g.~equation of time, sun position angles) are averaged over that time period for the shadowing calculations. For dynamic shading, TimestepFrequency is required to capture changes in shading transmittance.
When assessing heat gains in buildings due to solar radiation, it is necessary to know how much of each part of the building is shaded and how much is in direct sunlight. As an example, the figure below shows a flat roofed, L-shaped structure with a window in each of the visible sides. The sun is to the right so that walls 1 and 3 and windows a and c are completely shaded, and wall 4 and window d are completely sunlit. Wall 2 and window b are partially shaded. The sunlit area of each surface changes as the position of the sun changes during the day. The purpose of the EnergyPlus shadow algorithms is to compute these \textbf{sunlit areas}.~ Predecessors to the EnergyPlus shadowing concepts include the BLAST and TARP shadowing algorithms.

\begin{figure}[hbtp] % fig 38
\centering
Expand Down Expand Up @@ -73,10 +69,6 @@ \subsection{Surface Geometry}\label{surface-geometry}

Collinear -- points that essentially form a ``line'' rather than a surface shape.

Resolution of 1mm or less -- near collinear points.

Note that the resolution on surfaces/shadowing is 1 mm -- using resolution beyond that will result in truncation of the shadowing.

\begin{figure}[hbtp] % fig 40
\centering
\includegraphics[width=0.9\textwidth, height=0.9\textheight, keepaspectratio=true]{media/image605.png}
Expand Down Expand Up @@ -174,6 +166,19 @@ \subsubsection{World Coordinates to Relative Coordinates}\label{world-coordinate

\subsection{Shadow Projection}\label{shadow-projection}

Using the \textbf{ShadowCalculation} object, you can set how often the shadowing calculations are performed. Calculating them every timestep (Timestep frequency option) is obviously the most accurate but is also be the most time consuming.~ Using a greater length of time (number of days) before calculating again can yield speedier results.~ For lengths of time greater than one day, the solar position values (e.g.~equation of time, sun position angles) are averaged over that time period for the shadowing calculations. For dynamic shading, Timestep frequency is required to capture changes in shading transmittance.

EnergyPlus provides four methods for calculating sunlit fractions:

\begin{enumerate}
\item Polygon Clipping: The shadow algorithm is based on coordinate transformation methods similar to Groth and Lokmanhekim and the shadow overlap method of Walton.
\item Pixel Counting: GPU-rendering based calculations based on the method developed by Jones et al 2011.
\item Scheduled: Pre-calculated sunlit fractions are input through a schedule in the \textbf{\hyperref[surfacePropertylocalEnvironment]{SurfaceProperty:LocalEnvironment}} object.
\item Imported: Pre-calculated sunlit fractions are input through a \textbf{\hyperref[schedulefileshading]{Schedule:File:Shading}} object.
\end{enumerate}

The remaining description in this section describes the Polygon Clipping method. For information on the Pixel Counting method, refer to Jones et al 2011.

All architectural forms are represented by plane polygons. This can give good accuracy even for curved surfaces: a sphere can be approximated by the 20 nodes of an icosahedron with only 3 percent error in the shadow area cast by the sphere. Consider how a solid object, which is composed of a set of enclosing plane polygons, casts a shadow. Figure~\ref{fig:basic-shadowing-concept-structure} shows a box shaped structure on a horizontal surface. The structure consists of a top (surface 1) and four vertical surfaces (2 and 3 visible to the observer and 4 and 5 not visible). The sun is positioned behind and to the right of the structure and a shadow is cast onto the horizontal surface (the ground).

Surfaces 1, 4, and 5 are in sunlight; 2 and 3 are in shade. It is possible to think of the structure's shadow as the combination of shadows cast by surfaces 1, 2, 3, 4 and 5 or by 1, 4 and 5, or by surfaces 2 and 3.~ This last combination of shadow casting surfaces is the simplest. In the EnergyPlus shadow algorithm every surface is considered to be one of the surfaces that enclose a solid, and only those surfaces that are not sunlit at a given hour are considered shadowing surfaces.
Expand Down Expand Up @@ -240,6 +245,8 @@ \subsection{Shadow Projection}\label{shadow-projection}

More explicitly, a casting surface -- a shadow casting surface or general casting surface -- is one that casts a shadow on other surfaces. A receiving surface -- a shadow receiving surface -- is one that receives shadows from other surfaces (i.e.~casting surfaces). A back surface -- an inside surface -- is one that may be partially sunlit/receive solar transmission for interior solar distribution.

Note that the resolution on surfaces/shadowing is 1 mm -- using resolution beyond that will result in truncation of the shadowing.

\subsection{Homogeneous Coordinates}\label{homogeneous-coordinates}

Two-dimensional homogeneous coordinate techniques are used to determine the vertices of shadow overlaps. In homogeneous coordinates, points and lines are represented by a single form that allows simple vector operations between those forms {[}Newman-Sproul{]}.~ A point (X, Y) is represented by a three element vector (x, y, w) where x = w*X, y = w*Y, and w is any real number except zero. A line is also represented by a three element vector (a, b, c). The directed line (a, b, c) from point (x\(_{1}\), y\(_{1}\), w\(_{1}\)) to point (x\(_{2}\), y\(_{2}\), w\(_{2}\)) is given by:
Expand Down Expand Up @@ -789,6 +796,8 @@ \subsection{References}\label{references-041}

Zhang, Qingyuan, Joe Huang, and Siwei Lang. 2002. ``Development of Typical Year Weather Data for Chinese Locations'', American Society of Heating Refrigeration and Air-Conditioning Engineers, ASHRAE Transactions, Vol 108, Part 2.

Jones N., Greenberg D., Pratt K. ``Fast computer graphics techniques for calculating direct solar radiation on complex building surfaces''. Journal of Building Performance Simulation. Volume 5, Issue 5, Pages 300-312. June 26, 2011.

Threlkeld, J.L. and R.C. Jordan. 1958. Direct solar radiation available on clear days. ASHRAE Transactions 64:45.

Groth, C. C., and Lokmanhekim, M. 1969. ``Shadow ‑ A New Technique for the Calculation of Shadow Shapes and Areas by Digital Computer,'' Second Hawaii International Conference on System Sciences, Honolulu, HI, January 22‑24, 1969.
Expand Down
Loading