java3d
  1. java3d
  2. JAVA3D-553

Add shader binding for two-sided lighting flag

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.6.0
    • Component/s: j3d-core
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      553

      Description

      Java3D's API uses PolygonAttributes setBackFaceNormalFlip() to enable/disable
      flipping a normal vector for two-sided lighting. This is a wrapper to the
      OpenGL glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE | GL_FALSE).

      Unfortunately, this state information is not available to GLSL shader programs.

      Proposed enhancement to provide a uniform variable that indicates whether
      two-sided lighting is enabled. This could be a shader attribute binding.

      I have successfully produced a workaround solution that uses my own uniform
      variable in a shader program that is set by reading the value of
      getBackFaceNormalFlip(). An alternate idea would be to redesign the
      PolygonAttributes to use the Observer design pattern. Observers could monitor
      the states of the polygon attributes and perform customized actions when the
      attributes change.

        Activity

        Hide
        kcr added a comment -

        Set target milestone to 1.6.0

        Show
        kcr added a comment - Set target milestone to 1.6.0

          People

          • Assignee:
            java3d-issues
            Reporter:
            bheffner75
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: