Howdy! I have some specific questions:
-
Whats the normal matrix for? It seems it acts just like the world matrix which the default model vp says it is just an identity matrix for what i understood.
-
I have a material that is used to create the inverted hull technique and as such its not applied directly to a model or anything, its used solely on the render script. Is it possible to have an inspector for this material? It has a color attribute and itd be really cool to have it somehow in a inspector. Still on the inverted hull thing, i draw the models 2 times, one pass for the actuall model and the 2nd pass is the hull pass:
render.set_cull_face(graphics.FACE_TYPE_BACK)
render.enable_state(graphics.STATE_DEPTH_TEST)
render.enable_state(graphics.STATE_CULL_FACE)
render.draw(predicates.model.object, { frustum = camera.frustum })
-- inverted hull draw
render.enable_material('outline_material')
render.set_cull_face(graphics.FACE_TYPE_FRONT)
render.draw(predicates.model.object, { frustum = camera.frustum })
render.disable_state(graphics.STATE_CULL_FACE)
render.disable_state(graphics.STATE_DEPTH_TEST)
render.set_depth_mask(false)
render.disable_material()
-
The color attribute of the inverted hull material simply isnt sent if the material’s vertex space isnt in World space. Is this is an expected behaviour and if so, why? Its definetly not that the attribute and the model’s vertices have to match their space, cuz i can put the color in either Local or World and it wont work unless the vertices are in world space.
-
How could i bring the vertices and the normal into clipping space? Having those in clip space would allow me to make the effect distance independent. Also, its affect by the FOV of the camera, idk if that is a problem that can be fixed or it just works like that. Ive found few resources on this in specific for OpenGL, but i found a unity version, although im having troubles in translating to defold. It aint now way you call a function to multiply matrices in unity
Im sending a zip of the project in case of need. Thanks in advance!
Gradient Lighting.zip (119.0 KB)