Game Development Community

Question about lightmap materials

by Gerald Fishel · in Torque Game Engine Advanced · 12/13/2008 (12:16 am) · 3 replies

Hi all,

I'm currently attempting to implement some custom renderable objects. I want to be able to export some scenes from 3DS Max and Maya with baked lighting/shadows.

What's a good way to handle the rendering of lightmaps with the TGEA material system?

I noticed that you can specify multiple textures in the materials i.e. baseTex[0] and baseTex[1], but if I set baseTex[0] to my texture map and baseTex[1] to my light map, all I get is the lightmap rendered. I've tried playing with translucent and translucentBlendOp values for the second pass but it doesn't seem to make a difference. I just need a simple multiply of the texture sample by the lightmap sample.

Will I need to implement a custom material with my own shader for this, or is it something that can be accomplished with the default material system?

Thanks,
Gerald

#1
12/13/2008 (12:21 am)
Also, eventually I'd like to be able to contain all of the material information in my scene files, so I'll need to be able to construct materials entirely in the C++ code for my objects rather than using material scripts. What's a good place to look for examples or information on how to do this?

Thanks,
Gerald
#2
12/13/2008 (7:51 am)
Don't think it can be dun yet ...but the link below hes working on it

www.garagegames.com/blogs/105708/15776
#3
12/13/2008 (9:23 am)
Thanks for the link.

I was just wondering if the texture blending could be done with the base material system, I didn't want to do it with DTS, as I'm creating my own specialized renderable objects. However, after looking at his demo project I see that he's using a custom material for his rendering, so I just went ahead and dived into making a custom material myself, which was fairly painless.

I guess I needed to learn how to use the custom materials eventually anyway.