models emit light

Discuss the creation of various model formats for Quake engines, and related matters to modeling.
Post Reply
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

models emit light

Post by thorn3001 »

Good morning, someone could help me? the question is how to generate light in a model using DP, I think some weapons in Nexuiz emit light.

thanks
behind_you
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Post by behind_you »

self.effects = self.effects + EF_BRIGHTLIGHT works in regular quake, but in DP it's weird unless you change a cvar

or look at the tenebrae light extension in dpextensions.qc
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Post by thorn3001 »

ok thank you behind_you I investigate, I'm trying to do a project
Single player

Thorn
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Post by toneddu2000 »

You could use a shader for emitting light
(this shader works for sky, I don't know if it works for models too)
or, in DP, use a modeltexture_glow.tga for the model. Xonotic uses it too.

EDIT: If you want to add a light just like flashlight you could use this tutorial and modify it to show light only when that specific weapon model is used
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Post by thorn3001 »

Thanks toneddu2000, I need to make a monster with red eyes that emit light.

try to make suggestions and then posting.

Thorn
toneddu2000
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Post by toneddu2000 »

I need to make a monster with red eyes that emit light
a completely black texture with only red spots (better with a little of focus) and name it monster_glow.tga
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Post by thorn3001 »

I had something like that, but I want generate red light that is reflected in the walls, maybe make a face up the eyes and assing them an alpha texture with red dot. Thanks

Thorn
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Post by Nahuel »

thorn3001 wrote:I had something like that, but I want generate red light that is reflected in the walls, maybe make a face up the eyes and assing them an alpha texture with red dot. Thanks

Thorn
if you are using darkplaces add "self.effects = 128;" to the monster.
For example if you are using a dog. In dog.qc near to the end you find

Code: Select all

setsize (self, '-32 -32 -24', '32 32 40');
	self.health = 25;

	self.th_stand = dog_stand1;
	self.th_walk = dog_walk1;
	self.th_run = dog_run1;
Your code should be

setsize (self, '-32 -32 -24', '32 32 40');
self.health = 25;
self.effects = 128;//in darkplaces "128" is a red light
self.th_stand = dog_stand1;
self.th_walk = dog_walk1;
self.th_run = dog_run1;

Very easy!
hi, I am nahuel, I love quake and qc.
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Post by Nahuel »

Nahuel wrote:
thorn3001 wrote:I had something like that, but I want generate red light that is reflected in the walls, maybe make a face up the eyes and assing them an alpha texture with red dot. Thanks

Thorn
if you are using darkplaces add "self.effects = 128;" to the monster.
For example if you are using a dog. In dog.qc near to the end you find

Code: Select all

setsize (self, '-32 -32 -24', '32 32 40');
	self.health = 25;

	self.th_stand = dog_stand1;
	self.th_walk = dog_walk1;
	self.th_run = dog_run1;
Your code should be

setsize (self, '-32 -32 -24', '32 32 40');
self.health = 25;
self.effects = 128;//in darkplaces "effect 128" is a red light
self.th_stand = dog_stand1;
self.th_walk = dog_walk1;
self.th_run = dog_run1;

Very easy!
hi, I am nahuel, I love quake and qc.
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Post by thorn3001 »

Ok! Nahuel thanks
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Post by Seven »

Hello thorn3001,

what Nahuel explains is this dpextensions function:
DP_EF_RED

If you want another color or another intensity of the light, you should use this one:
DP_ENT_GLOW

It produces remarkable effects.
I use this fantastic function regularly.
It gives amazing ambience boost.

Kind regards,
Seven
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Post by thorn3001 »

thanks Seven, but please explain me, how can use this function? exist any tutorial?

moreover, for the creation of my monster, this function will not achieve my goal (emitting red eyes), but I will use it for something else.

:shock:
Thorn
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Post by mankrip »

I suppose what you want is something similar to this.

Maybe this thread and this other one can help.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Seven
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Post by Seven »

Hello thorn3001,

sorry for my late reply.
If you are still interested in using DarkPlaces DP_ENT_GLOW,
here is an random example of how to use it:

Code: Select all

void()	alt_death8 	= {
	self.avelocity = '0 350 0';   
	self.alpha = 0.19;
	self.glow_color = 5;       // this sets the glow color (8-bit value  0...255).  75 is red
	self.glow_size = 250;	   // this sets the intensity (0 ... 1020)
	self.nextthink = time + 0.2;
	self.think = alt_death9;
};
This is how it is explained in dpextensions.qc:

Code: Select all

//DP_ENT_GLOW
//idea: LordHavoc
//darkplaces implementation: LordHavoc
//field definitions:
.float glow_color;
.float glow_size;
.float glow_trail;
//description:
//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light.
It is really simple to use as you can see.
Hope it helps you a bit.

Kind regards,
Seven
thorn3001
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Post by thorn3001 »

Ok!!! Seven Thank you!!!! :D
Thorn
Post Reply