BenRK
Member
So I'm trying to come up with things like material shaders and outlines and 3D lighting. I am NOT asking for someone to make these for me, I more want a point in the right direction. I have several questions.
First thing I've noticed is shaders don't seem to apply to 3D models correctly when I use matrices to move them around. I've tried following tutorials, and they work without the translations/rotations/scaling, but not with them. Is there something I'm missing here? I assume I need to pass the matrix to the shader somehow, I was under the impression the vertex shader picked up that info automatically.
This is my current draw code for translating 3D models:
Another thing I'm having a hard time wrapping my head around is making an outline shader in 3D. I absolutely understand it in 2D, but I'm not sure how to go about this in 3D. One way I was thinking was drawing the 3D scene to a surface (at least the objects I want to have outlines) but with the models in a solid color with no shading of any kind, and then going over this surface with a 2D outline shader before drawing the surface. Is there a better way of doing this? I have to imagine this method would leave me with plenty of depth issues to work out.
Anyway, again, not looking for anyone to make this stuff for me. I'm just needing a kick in the right direction.
First thing I've noticed is shaders don't seem to apply to 3D models correctly when I use matrices to move them around. I've tried following tutorials, and they work without the translations/rotations/scaling, but not with them. Is there something I'm missing here? I assume I need to pass the matrix to the shader somehow, I was under the impression the vertex shader picked up that info automatically.
This is my current draw code for translating 3D models:
GML:
//shader stuff out here?
var mat = matrix_build(x,y,z,0,0,direction,1,1,-1)
matrix_set(matrix_world,mat)
//shader stuff in here?
vertex_submit(model,pr_trianglelist,-1)
matrix_set(matrix_world,matrix_build_identity())
Anyway, again, not looking for anyone to make this stuff for me. I'm just needing a kick in the right direction.
Last edited: