Skip to Main Content
Construct 3 suggestions 21H2 - ARCHIVED

This suggestions platform is now closed and will be shut down on March 1st 2024.

Please ensure any content you care about is backed up before that date.

Feature requests are now handled on GitHub here: https://github.com/Scirra/Construct-feature-requests

12 VOTE
Categories 3D
Created by Mikal Dev
Created on Jan 19, 2022

Add support for world_position as uniform for effects - enable 3D lights!

For the new 3D feature set of C3, we can make the visuals even better with interesting 3D focused effects/shaders. For example I have made a simple constrained lighting shader that uses the new depth texture to create normals to the view camera.

For other more sophisticated effects like world based lighting, we need the world position, if the vertex shader can pass this to the fragment shader. If we have it, we can create fragment based lighting, point lights, and spotlights. It will be a nice leap forward for C3 3D mode.

If we cannot get the world_position passed from the vertex shader we can calculate with the inverseProjection and inverseView matrix.


If those can't be passed, we can use separate View and Projection matrices passed as uniforms. Currently, MV and P are passed, but we need separate M and V for creating the world position of pixels based on depth and the screen x,y coordinates.

Example of this type of lighting shader in GM2:

https://www.youtube.com/watch?v=nk2rLJOdLKE

  • Attach files
  • +8