Page 1 of 1

models emit light

Posted: Tue Jul 05, 2011 4:14 am
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

Posted: Tue Jul 05, 2011 6:20 am
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

Posted: Tue Jul 05, 2011 6:45 am
by thorn3001
ok thank you behind_you I investigate, I'm trying to do a project
Single player

Thorn

Posted: Tue Jul 05, 2011 7:57 am
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

Posted: Tue Jul 05, 2011 2:49 pm
by thorn3001
Thanks toneddu2000, I need to make a monster with red eyes that emit light.

try to make suggestions and then posting.

Thorn

Posted: Tue Jul 05, 2011 4:29 pm
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

Posted: Tue Jul 05, 2011 6:37 pm
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

Posted: Tue Jul 05, 2011 6:52 pm
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!

Posted: Tue Jul 05, 2011 7:02 pm
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!

Posted: Tue Jul 05, 2011 7:30 pm
by thorn3001
Ok! Nahuel thanks

Posted: Thu Jul 07, 2011 1:21 pm
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

Posted: Thu Jul 07, 2011 3:46 pm
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:

Posted: Fri Jul 08, 2011 1:53 am
by mankrip
I suppose what you want is something similar to this.

Maybe this thread and this other one can help.

Posted: Fri Jul 08, 2011 1:57 pm
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

Posted: Fri Jul 08, 2011 3:26 pm
by thorn3001
Ok!!! Seven Thank you!!!! :D