OpenGL texture tutorial

geotrupede's icon

Does anybody know of a good tutorial for texturing / using materials?
I am interested in the following:

-1- remove specular component from a texture (so that the colour is not a function of the angle of view)

-2- add emissive texture from a video to an object

-3- apply material selectively to different 3d models from different files and from same file but different groups

Thanks,
G

Rob Ramirez's icon

1 - set @mat_specular 0 0 0 0 on either the gl object or the gl.material (with @overide 1)

2 - send a matrix to the emissive input of gl.material

3 - create a gl.material object for each material you want, and attach to whatever 3d objects you want to have this material.

Max Patch
Copy patch and select New From Clipboard in Max.

for the gl.model groups case, it's much more complicated, but doable using the sendmaterial message. the following example patch demonstrates this:
Max 6.1/examples/jitter-examples/render/model/model.material.edit.maxpat

Abao's icon

Hi

I was looking for the same solution, but how does the emission function works on max object? how to make a emissive object and let the other object reflects it? thank you!

Luke

Rob Ramirez's icon

there is no built-in functionality to facilitate that, you will have to write some custom material shaders.
max 7 will introduce some new features that make these kinds of global-illumination techniques much easier.

for now, you can simply link a gl.light to the position of your emissive gl object, and adjust the atten attributes appropriately.

Abao's icon

Thank you Rob!

Abao's icon

hi Bob

it seems the gl object still can not react to the emission light from other gl object, can you explain what to you mean by "global-illumination" and how can I use them in Max7? thank you!

Rob Ramirez's icon

you can use the new MRT (multiple-render-target) features of jit.gl.node to create a deferred shading implementation, where each of your emissive objects acts as a light source. the mrt.deferred.shading example give a very basic demonstration of this technique. you would have to create your own shader to replace the mrt.render.directional.jxs, that handles the lighting for each of your emissive objects.