
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).
| Updated | 3 days ago |
| Status | In development |
| Category | Assets |
| Rating | Rated 5.0 out of 5 stars (4 total ratings) |
| Author | kindeyegames |
| Made with | Construct |
| Tags | 3D,addon,construct-3,Effects,Shaders |
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:
Log in with itch.io to leave a comment.
Do you mean the 3DObject lights controlled by ACEs in 3DObject (it is not an effect) or something else? A screen shot of what settings you are talking about would help.
If you are looking at light layer, effect it does not handle world position lights, only relative to view and no normal or phong support.
Hello , i get this warning
[WebGL] Shader program 'mikal_frag_light-8' compilation log: C:\fakepath(367,13-35): warning X4008: floating point division by zeroC:\fakepath(367,13-35): warning X4008: floating point division by zeroC:\fakepath(367,13-35): warning X4008: floating point division by zeroC:\fakepath(367,13-35): warning X4008: floating point division by zero
when i export to html5 it does run on pc browser but throws error in phone browsers
Check that the renderer is webgl2 in the project setting, only webgl2 now is supported for the effect, I will update the webpage and remove older versions.
I suggest adding 3dobject (free addon) to your project. It will handle what main.js previously did, and you can leave out main.js.
Light types
Thank you very much. Unfortunately the project was saved in r423 beta and I am using r416.2 stable. I see it running in the browser as intended, but can't figure out how to update my desktop version to r423 beta - preference is to stay using stable. 3D Oject addon is installed.
Enabled WebGPU in previous release mikal_frag_light-8-2.8.0 -
Light flashes on for a moment, then screen goes black.
Error log -
instance.js:241 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bindBuffer')
at Object3DInstance.Tick (instance.js:241:25) etc
6instance.js:241 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'bindBuffer')
at Object3DInstance.Tick (instance.js:241:25)
at _isTicking._tickFunc._tickFunc (sdkInstanceBase.js:1:3025) etc
gltfModel.js:130 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'currentShader')
at GltfModelTop.setVertexShaderModelRotate (gltfModel.js:130:38)
at GltfModelTop.render (gltfModel.js:245:12) etc
It seems to still wan to use main.js as when I delete it, there isn't even a flash of light. Error log after deleting main.js -
domSide.js:16 Uncaught (in promise) GPUPipelineError: The fragment input at location 2 doesn't have a corresponding vertex output.
at ValidateInterStageMatching (..\..\third_party\dawn\src\dawn\native\RenderPipeline.cpp:781)
On opening 3DObjectFragLight after Construct 3 update to r424 stable, I got the following notification:
It would be great if only the latest versions on one download page and older versions on a different download page.
The documentation seems outdated. It says This effect requires the main.js file from the example project to be included - yet in the comments here it says it is not required.. which is it? Also - there is no documentation about the different light types - what does each one do?
hey I'm having trouble opening the example projects. My Construct 3 shows that they aren't valid .c3p files... Do you happen to know why is this happening? This message only appears in older example files too, the fog and screendoor example work just fine. I tried using a stable release instead of beta versions too, that didn't work either
I just tried:3DObjectFragLight-8.c3p and FragLightTrain.c3pand they worked for me. Make sure you are using the latest version of the effects and 3dobject addon. When using the latest 3DObject in 3DObjectFragLight-8.c3p, remove the main.js script from the project (the addon does the change itself.)
If you still see an error on loading, Hit 'F12' to bring up dev console and take a snapshot of the error and post it here.
This does per pixel shading, however the pixel normal is calculated from the tangent of nearby pixels, so it is effectively a plane. The difference from 3Object lighting is that the light attenuation can vary across the face of a polygon. Additionally spotlight edges can vary across the face of a polygon. Finally, you can enable procedural normals based on diffuse texture which can further vary the normal and light calculation.
I am also experimenting with adding normal map support to this effect with 3DObject, it is not yet available, but if the experiment works out, I'll add it as an option.
Thanks for the response!
So in this case, is it possible to get smooth shading using procedural normals? Are procedural normals available in this plugin or are you referencing the procedural normals effect? (sorry for the rapid-fire questions)
Having more normal support on the 3D object would be awesome! I think that currently not being able to have smooth shading is holding back the 3DObject and lighting. Would love to get some smooth shading, as right now the only option I seem to have is making a duplicate of the sphere mesh and fake the shading with a gradient effect, which will cause me to have an extra mesh and draw call.
Thanks for the response,
I see, even with normal mapping it would be easy enough to create a normal map that smooths out the surface, so one could just do that I guess.
Regarding the commissions, that's good to know! Definitely will be considering at some point. Is there a platform to submit commissions, what are your rates?
This depends on the requests I have made for SDK V2, waiting for a response from Scirra. In the past requests have takes months to years to get implemented. If they implement the requests, main.js will no longer be needed.
Scirra has said the current SDK will be supported at least for two more years (through C3 SDK V1 LTS), which is what is used with the main.js file.
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.