Forum

models emit light

Discuss the creation of various model formats for Quake engines, and related matters to modeling.

Moderator: InsideQC Admins

models emit light

Postby thorn3001 » Tue Jul 05, 2011 4:14 am

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
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Postby behind_you » Tue Jul 05, 2011 6:20 am

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
User avatar
behind_you
 
Posts: 237
Joined: Sat Feb 05, 2011 6:57 am
Location: Tripoli, Libya

Postby thorn3001 » Tue Jul 05, 2011 6:45 am

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

Thorn
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Postby toneddu2000 » Tue Jul 05, 2011 7:57 am

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
toneddu2000
 
Posts: 1388
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby thorn3001 » Tue Jul 05, 2011 2:49 pm

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

try to make suggestions and then posting.

Thorn
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Postby toneddu2000 » Tue Jul 05, 2011 4:29 pm

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
toneddu2000
 
Posts: 1388
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Postby thorn3001 » Tue Jul 05, 2011 6:37 pm

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
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Postby Nahuel » Tue Jul 05, 2011 6:52 pm

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.
User avatar
Nahuel
 
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby Nahuel » Tue Jul 05, 2011 7:02 pm

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.
User avatar
Nahuel
 
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Postby thorn3001 » Tue Jul 05, 2011 7:30 pm

Ok! Nahuel thanks
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Postby Seven » Thu Jul 07, 2011 1:21 pm

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
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Postby thorn3001 » Thu Jul 07, 2011 3:46 pm

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
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col

Postby mankrip » Fri Jul 08, 2011 1:53 am

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
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Postby Seven » Fri Jul 08, 2011 1:57 pm

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
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Postby thorn3001 » Fri Jul 08, 2011 3:26 pm

Ok!!! Seven Thank you!!!! :D
Thorn
User avatar
thorn3001
 
Posts: 29
Joined: Tue Jun 28, 2011 6:09 am
Location: Bogotá, Col


Return to Modeling

Who is online

Users browsing this forum: No registered users and 1 guest