Demo - drag and drop the 3DShapes and the Cleric.

Combined Effects:

  • Fragment 8 light
  • Directional light
  • Depth Fog
  • Height Fog
  • Screendoor transparency

Support for one or eight 3D world based lights, directional light, fog, screendoor transparency, works on 3DShape, 3DObject and some 2D objects. Tilemap not supported (first shader is tilemap fragment shader).

Usage notes:

  • It must be the first effect on the 3DShape or 3DObject
  • Currently 3DObject will only work with webGL23DObject Now supports webGPU also, but requires some CPU perf to make it work with 3DObject.
  • To set spotlight cone angle, in the effect parameter Spot cos(angle) value, set it to cos(spotlight angle). The reason to set this as a parameter is so we don't need to calculate cos(angle) for every fragment to save performance. The value should be around 0.9 or so for a fairly tight spotlight.
  • The spotlight direction should be a unit 3 element vector which points in the direction of the cone of light (with z of -1 pointing away from the default viewport, without moving the camera)


This effect requires the main.js file from the example project to be included in other projects using this effect, it patches the runtime engine to enable this effect.  CAUTION - this may mean this effect could become non-functional in future versions of C3. We will work to make sure this does not happen and we have requested for these changes to be incorporated into the C3 engine, so it will not be an issue in the future.

Development notes: 

  • *DONE* 8 light versions to come next
  • *DONE* Working on webgpu patch for 3DObject to work with lighting
  • *DONE* Request changes to C3, so that the main.js changes will not be needed.
  • C3 implement the requested changes above.
StatusIn development
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(3 total ratings)
Authorkindeyegames
Made withConstruct
Tags3D, addon, construct-3, Effects, Shaders

Purchase

Buy Now$10.00 USD or more

In order to download this asset pack you must purchase it at or above the minimum price of $10 USD. You will get access to the following files:

3DObjectFragLight-1-0-0.c3p 3 MB
mikal_frag_light-1-1.0.0.c3addon 2 kB
3DObjectFragLight-8.c3p 9 MB
FragLightTrain.c3p 342 kB
Rally Fragment Light 3DObject.c3p 3 MB
ssao-1-6-0.c3addon 6 kB
mikal_frag_light-8-1.2.0.c3addon 7 kB
mikal_frag_light-8-1.3.2.c3addon 9 kB
FogExample.c3p 272 kB
mikal_frag_light-8-1.4.0.c3addon 9 kB
Screendoor.c3p 167 kB

Development log

View all posts

Comments

Log in with itch.io to leave a comment.

Does the effect work when exported to Android?

I would think it would on any modern android platform, but have not tried it.

(+2)

Well that’s an instant purchase if I ever saw one. Thanks for pushing the 3D related capabilities of Construct, Mikal & Federico!

Thank you!

hi, any chance to add tutorial where edit size / position/ color for light in js code?

(1 edit)

With this version (early in development), you do not set the position/color in js code. You use the effect parameters. You can set them as properties in the editor or change them at runtime with events with the set effect parameter action. The JS code is now only to patch the vertex shader to enable the effect/addon.