Advanced GLSL shaders

Hi there!

I’ve learned about Defold recently and fell in love with its internal structure (messaging system, code organization etc)
But what I’m trying to do now is to use it as 3D engine (I know, may be it’s not the best idea for now). And already have kinda problem:

  • How should I properly pass for example a model matrix to a shader? When I use regular constants I can set max 4 of them and then I get a message:

“Out of per object constant slots, max 4, when setting constant model_matrix_c3”

Since it’s possible to pass only vector4 constants (am I right?) then four contants is totally not enough to make cool shaders with lighting. May be I can increase this limit somehow?

P.S.

Also I’m working on Blender plugin for Defold (the idea is to use blender just for placing 3d objects). I think it’s the best fit. A little later I’ll create a WIP topic.

Also going to rock the ludum dare with this combination, let’s see >B) Good luck to all participants!

Yours faithfully,
Defold lover / Unity3d hater

6 Likes

That’s so cool! We do appreciate your initiative, as we’re working on more 3D features in the editor/engine and all feedback is very welcome.

Did you do anything for LD36, or are you targeting the next one?

1 Like

Completely missed this post, sounds great! The shader support needs much more love as you have discovered. We will try to address the constants situation during the autumn as we are improving the 3D support overall. But you are right, you can only pass vec4’s and too few of them in the current API.

3 Likes

Hey, nice to hear!

I think I will use 3D for the next one (but also it’s possible that I go 3d for gamesjam.org competition). I’ve already done some tests with shaders (phong lighting).

2 Likes

Awesome Blossom! =] Can’t wait to see what you gonna come up with.

2 Likes