Frag light effect support for experimental frag effect


This is pretty experimental, but it adds support for a project which patches the C3 runtime to enable per fragment lighting for 3DObject.

The project is included here.

Currently only works with non-worker animation mode (if it proves promising, will add worker mode)

Look at main.js for some info on how to add and change lights (color, position, spotlight, direction, etc.)

The position of a light can be controlled, but they will all use the same offset for the control.

Only 3DObjects will be lit and work, do not use other C3 rendered objects (e.g. Sprite, 3DShape, Tilebackground, Text) - However, of course can create entire levels of 3DObjects.

HTML elements will render (e.g. button, input box)

Try it out! If you do changes to the project (js, etc.) please share, let's work on this together).


Files

3DObjectFragLight.c3p 3 MB
78 days ago
3DObject-2-59-0.c3addon 113 kB
78 days ago

Get Construct 3 3DObject Plugin

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

Not able to export 3D object to Android. Am I missing something in settings or is it just not possible. I get error "build failed"

I don't know of any reason it should not export. Don't do minify (if that is an option). Others have exported to Android and released mobile games. Can you export other C3 example projects to Android and it works?

Any other detail on error messages?

I just tested this and its about 1000x faster than old face light lol. Amazing.

(1 edit)

Yup! That's what we could do if C3 added effect SDK to let us change vertex shader and first fragment shader for 3D objects! Which I have requested many times. Also the first fragment shader would let us use uniforms, so the lights could be controlled individually during runtime.

Aw, that just gave me a good idea too. Putting a light on each bullet and shoot it down a dark hallway would look so cool.

How you do that? I instal new version of plugin, i run my game and i dont receive better performance

He's comparing using flat shaded lighting ACEs of 3DObject vs using effect based lighting from the frag lighting experiment. Two different techniques.

ok, there is any chance to use this new method without SJ code?

(1 edit)

This is just experimental, probably shouldn't use it seriously yet, but all you have to do in the code is change values of the lights colors and positions and angles. Very easy, there is comments.