Major shader management changes

Error message

  • Notice: tempnam(): file created in the system's temporary directory in drupal_tempnam() (line 2552 of /users/apache/www.irs.uji.es/htdocs/uwsim/includes/file.inc).
  • Warning: file_put_contents(): Filename cannot be empty in file_unmanaged_save_data() (line 1986 of /users/apache/www.irs.uji.es/htdocs/uwsim/includes/file.inc).
  • The file could not be created.
  • Notice: tempnam(): file created in the system's temporary directory in drupal_tempnam() (line 2552 of /users/apache/www.irs.uji.es/htdocs/uwsim/includes/file.inc).
  • Warning: file_put_contents(): Filename cannot be empty in file_unmanaged_save_data() (line 1986 of /users/apache/www.irs.uji.es/htdocs/uwsim/includes/file.inc).
  • The file could not be created.

We have completely updated the shader management of UWSim. Now shaders are created for each camera and main view, instead of for each object. This allows us to easily maintain shaders and use different shader effects on each camera.

Now osgOcean shaders are used, so the copied version of them present on data/shaders have been deleted, only maintaining default_scene shader, which is our custom object shader with added functionality such as structured light projector. This shader has been slightly optimized, so a small performance increase may be noticeable on some scenes.

Furthermore, this update also fixed some osgOcean underwater effects done through shaders asĀ  uniforms were not correctly passed to virtual camera shaders.

Finally, depending on the texture and object colors some objects were showing wrong appearance, this should be fixed now. This was particularly noticeable in the ship of the shipwreck scene. See below the before(left) and after(right) images.

Besides this, an ARMask (Augmented Reality Mask) has been added to osgOcean in a way that every object using this mask should be visible only in the main view. This mask, has been applied to frames, frame labels, multibeam and range sensor debugs, trails ...etc. This means that now, virtual cameras should only see the raw scene without added information.

As this update required "major" modifications, bugs may appear, so please report any issue in the git repository as usual.