Turning ON the lights

Here's my problem. I want to have a planet model for example (but this could be a spaceship as well) to have two textures, one for the normal daytime diffuse layer and one emissive layer for night lighting. Is this possible in jME? I've tried many different methods, multi-texturing in jME, different approaches in 3ds, but nothing seems to work. I'm going from 3ds to milkshape then to jME using the formatConverter.jar. Ideally, I'd just like to be able to setup the textures in 3ds with their values set there, but if a programatic approach will work, that'll do as well as I'm desperate at this point. I've played around with TestMultitexture, but even with that simple example, I can't figure out a way to set the emissive values of the textures individually.



I would think this might be standard excercise for many games and I'm guessing that it's painfully simple, but I'm just not getting it.



:expressionless:

I believe I know the textures you mention as I had them and considered doing something like that for FurBallz.  The best way I saw was to use shaders (GLSL specifically) because you basically used normals and a light source to swap between using one texture or the other at a given vertex.  You could do that programatically of course, but it may be rather slow (depending on the complexity of your sphere I'd guess.)

Thanks for the reply Renanse. Ok. I'll look into that, but as far as you know it is not possible to set the emissive value for textures separately in jME? I could live with the lights showing a little bit on the daytime side of the planet. I'd just set the value a bit low so they wouldn't be too noticeable.


I don't understand what you mean by setting the emissive values of a texture. Emissive attributes are set in the material state, but don't depend on a texture.

Understood. But you may only have one material state per model. What I'm trying to do is have one model (a planet or spaceship with lights) where I have a texture which shows the normal lit diffuse image and would have an emissive value of 0 and also a texture which would only contain the lights for the model which would have an emissive of say 30, so that when the object was in shadow you would see the lights glowing on it. It's almost like wanting to have two material states set for the same model, but each would have it's own texture. I know this is not right and outside of what jME currently does (from what I understand).



Picture this. You're out in space looking at the Earth with the terminator running right down the middle of the Atlantic Ocean. Europe is in sunlight and you see the land and oceans, but the East Coast of the US is in darkness and you see the night lights of the cities. That's what I'm shooting for.

I understand what you are looking for, but like Mojo, I'm not sure how emissive values are going to solve it.  Look at the official OpenGL Shading Language book (aka 'the orange book'), page 241 onward.  (Also see color plate 6)  It's exactly the effect you are looking for.