Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-44874

multiple uniform blocks not working

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Not Evaluated
    • None
    • None
    • Qt3D
    • None
    • Linux 64bit / Nvidia GTX 970

    Description

      Basically I tried to extend the deferred rendering example to have a mix of pointlights and spotlights.
      So in QML (FinalEffect.qml) I did this:

                  parameters: [
                      Parameter {
                          name: "PointLightBlock"
                          value: ShaderData {
                              property ShaderDataArray pointLights: ShaderDataArray {
                                  // hard coded lights until we have a way to filter
                                  // ShaderData in a scene
                                  values: [ sceneEntity.light, light3.light ]
                              }
                          }
                      },
                      Parameter {
                          name: "SpotLightBlock"
                          value: ShaderData {
                              property ShaderDataArray spotLights: ShaderDataArray {
                                  // hard coded lights until we have a way to filter
                                  // ShaderData in a scene
                                  values: [ cone.light ]
                              }
                          }
                      }
                  ]
      

      And in the fragment shader this:

      struct PointLight
      {
          vec3 position;
          vec3 direction;
          vec4 color;
          float intensity;
      };
      
      struct SpotLight
      {
          vec3 position;
          vec3 direction;
          vec4 color;
          float intensity;
          float cutOffAngle;
      };
      
      const int pointLightCount = 2;
      const int spotLightCount = 1;
      
      uniform PointLightBlock {
          PointLight pointLights[pointLightCount];
      };
      
      uniform SpotLightBlock {
          SpotLight spotLights[spotLightCount];
      };
      

      Unfortunately enabling the second uniform makes the renderer display a black screen

      Full code available here: https://github.com/mcallegari/qmlplayground/tree/master/DeferredSpotShadow

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lemire_p Paul Lemire
            mcallegari79 Massimo Callegari
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes