Skip to content

Commit

Permalink
Add design document.
Browse files Browse the repository at this point in the history
  • Loading branch information
nealkruis committed May 16, 2019
1 parent cf37de5 commit 7794e71
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions design/FY2019/GPU-Shading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
GPU-based Shading Calculations
==============================

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

## Justification for New Feature ##

## 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 ###

### 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.

### 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`. 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

7 comments on commit 7794e71

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

penumbra-integration (nealkruis) - x86_64-MacOS-10.13-clang: Tests Failed (1866 of 2408 tests passed, 118 test warnings)

Messages:\n

  • 655 tests had: EIO diffs.
  • 537 tests had: Table big diffs.
  • 1 test had: AUD diffs.
  • 1 test had: MTD diffs.
  • 1 test had: MTR big diffs.

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 739
  • Failed: 5

regression Test Summary

  • Passed: 118
  • Failed: 537

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (6 of 6 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: Build Failed

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: Build Failed

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

penumbra-integration (nealkruis) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: Build Failed

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

penumbra-integration (nealkruis) - Win64-Windows-10-VisualStudio-16: Build Failed

Failures:\n

integration Test Summary

  • Passed: 1
  • Failed: 656

regression Test Summary

  • Passed: 653
  • Failed: 2

Build Badge Test Badge

Please sign in to comment.