Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Thermal Vision

Author
Message
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 21st Jun 2010 06:41
Alright so I am embarking on a game and am still in the planning stages of it. I want to have the player able to activate a heat/thermal/Infra Red vision ability to see in dark places and such. It's not something that hasn't been done before, I just can't figure out a good way to do it.

There is the easy way: each 3d object has 2 textures (1 for regular and 1 for thermal) and just switch out every texture when you change vision styles. This would seem clunky and prone to failure, since if something is missed for whatever reason, it could look thermal walking around when nothing else is.

Is there any other way you guys could think of to do it?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
pictionaryjr
11
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 21st Jun 2010 07:31
take a screenshot. alter the colors and paste that image on the screen. only way i could think to do it

Dark Dragon
13
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 21st Jun 2010 19:16
Play with the SET GAMMA Command, and set it to an orange. Should get a nice effect....

Robert The Robot
13
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 21st Jun 2010 19:28
Set Gamma only works if you have DBC in full screen mode though - if you're after the high frame rate/low CPU usage commands, that won't work.

How about a ghosted, coloured plane located just in front of the camera - night vision cameras I've seen are often either black&White (hard to do in DBC without a texture change) or they make the whole seen look pale green. Worth a try...

"I wish I was a spaceman, the fastest guy alive. I'd fly you round the universe, in Fireball XL5..."
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Jun 2010 20:38
I think BN2 is looking for something like this : http://www.youtube.com/watch?v=xzigMsrQUOE

The plain-in-front-of-the-camera trick and the gamma will only blend the scene into one color.

This is going to be quite tricky to do in DBC...

TheComet

BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 22nd Jun 2010 04:56
So I had another idea, but it would essentially cut my usable resources in half. Have the entire environment duplicated at all times. Every enemy in the non-active one just copies what its other version does. In one "land" everything has the thermal textures (perhaps use some blue fog in order to complete the effect). When you switch, you just start controlling the other player object and the camera jumps to the other side.

Thoughts on this?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Jun 2010 07:19
Your first idea with the thermal textures makes more sense to me than replicating all of the objects. The thermal textures can be very small to keep the resources low because they do not have to be detailed. Just a graduation from white at the hottest spot to black or dark blue at the coldest. You could use 32x32 textures, maybe and even animate them by switching the images.

One of the hard parts would be the UVs for the object. You'd have to make sure you paint your thermal images the correct way. You could start with real texture and add the thermal highlights to that. It seems like it would be a lot of work, but it also seems possible.

Another way might be to use a partical system and material settings. You would use plains textured with maybe an oval heat shape - light to dark eminating from the center. You change your main objects diffuse to 0 so they have only a black color with no detail - more of a shape/sillouette (sp?). You then position the plains at the object/limbs or at calculated points. Make sure the ghosted plain is facing the camera. You can use many plains with different colors to indicate the heat intensity. It makes sense in the old coconut, but not sure about the actual implementation.

Enjoy your day.
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 22nd Jun 2010 21:29
The textures will look weird if you rotate the object, won't they?

TheComet

Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Jun 2010 23:45
Quote: "The textures will look weird if you rotate the object, won't they?"

The planes? Probably. But instead of large planes one could create a particle system that eminates outward from the center of the object with a thermal signature with small planes or cubes. Use collision to detect the extremes. Almost like flames or smoke, but limited by the extents of the object. Maybe a bit overkill.

@bn2
I was playing around and through careful manipulation of diffuse, emissive and lighting, you can make objects glow with particular colors where their base texture or color is obscured. Or you can highlight colors leaving indications of the textures but glow with your choice of color.

The area ambient light should be 0
color ambient light 0

And you have to adjust light 0 to face wherever the camera is facing. You can do this by placing an object at the camera's position, orient the object to the camera, and then move it forward a short distance.

Then get the vector direction by subtracting the camera position from the object's position. This is the direction to use in
set directional light 0,x,y,z
You can of course, change the color of light 0 as well to change the intensity of particular channels.

Enjoy your day.
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 23rd Jun 2010 00:26
Hmm thats an interesting idea. Thanks latch, I try that out soon (I have been working on another aspect of the game and I'm almost done with it)

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 26th Jun 2010 10:55
Alright, I was experimenting with some of the lighting tips, Latch, couldn't figure out how to change the diffuse levels and such through dbc.

Started experimenting with textures that have the normal one on one side, the thermal one on the other and I just scroll the texture to make it work. It looks alright, but lacks the glow and consistency I am really looking for.

I did have another interesting idea, though I am sure it would sound stupid to anyone who is familiar with 3d modeling. Is there a way that I can make the material 2 sided, with normal on the outside and thermal on the inside then just flip the normals when in thermal mode?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Jun 2010 13:11
Quote: "Is there a way that I can make the material 2 sided, with normal on the outside and thermal on the inside then just flip the normals when in thermal mode?"


Flipping normals? No idea how that would work... Hiding the "outside" normals would cause you to see the "inside" normals, but the whole model would be inverted.

TheComet

BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 26th Jun 2010 14:11
Yeah...that idea made more sense in my head. So far my most successful attempt has been the scroll texture thing, though I would really like to try out some of the stuff latch suggested before I stick with a "good enough" option.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Jun 2010 18:53
@bn2
I don't have access to DB at the moment but I'll try to knock together an example without testing it. And 'glow' isn't quite the word. More like, light up with the set light/material color:



This code should point the directional light 0 in whatever direction the camera is facing. Each object should have a random intensity of green and should light up according to the diffuse setting. Play with ambient diffuse and emissive to try and reach the desired effects. Emissive is the all around glow emitted directly from the object that doesn't need a light source. Diffuse is the surface color reflected directly from the object, ambient is the objects response to area outside light. This differs from diffuse because it is the intensity of the light striking the surface of the object, not the light that is reflected back. you'll have to play with both to see the varying effects. Also check out the sticky - DBC 1.20 controls explained for some insight on these material controls.

Enjoy your day.
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 30th Jun 2010 02:32
Cool! Thanks latch! I forgot to update my dbc to 1.2 (beating head against wall now). Those material commands really did the trick. Screen Shot attached.

Exactly what I did:

1)Texture Work: The texture consists of 2 parts. One is the texture and the other half is pure white. When You switch, I used Scroll Texture to set it to white.

2)Ghost object On

3)Fade Object 115: I played with this number to get the effect I wanted. This is what gives the white parts.

4) set object diffuse 1,rgb(255,255,0)

5) set object emissive 1,rgb(255,127,0)

6) set object ambient 1,0

7) set object specular 1,rgb(255,255,255),100

4-7: I pretty much just played with these to make it look right. Got em mostly on the first/second try. Ambient light right now is set to rgb(0,0,127) to make normal things dark. Number 6 will keep the object bright looking.

Thanks for the help guys!

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose

Attachments

Login to view attachments
Sepnon
10
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 30th Jun 2010 18:39
lol nobody noticed.. that video is not a real thermal cam
no way his head is colder than his clothes
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 30th Jun 2010 23:48
Well yeah, laptops generally aren't built with IR sensing tech (though that would be pretty awesome). I don't know what algorithms it uses though (probably proximity or something). The effect though would pass in a game, since you really only need to get the general idea.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose

Login to post a reply

Server time is: 2020-08-13 18:12:24
Your offset time is: 2020-08-13 18:12:24