Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (NewbieZorro, TipmyPip, AndrewAMD), 14,749 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Adding Lights in SED #227184
09/12/08 23:58
09/12/08 23:58
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
Ok my fetish for silly questions carries on, but my quest of the day is... how do you add lights to the world in SED? I mean like, dynamic-shadow-casting-lights as currently anything i create seems to have "r_fullbright 1" mode on!


I am a noob to this... Blitz3D is where i am best at!
Re: Adding Lights in SED [Re: CdeathJD] #227186
09/13/08 00:28
09/13/08 00:28
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Invisible lightsource
Code:
ENTITY* lightsource = ent_create( NULL, vector(x,y,z), NULL);  //create light point
lightsource.lightrange = greater_than_zero;  //make it light up other stuff


visible lightsource
Code:
ENTITY* lightsource = ent_create( "lightbulb.mdl", vector(x,y,z), NULL); //create lightbulb
set(lightsource,LIGHT);    //make it brightly lit
lightsource.lightrange = greater_than_zero;   //make it light up other stuff


Color of light (both dynamic) is adjusted by entities red, green, blue properties.

Dunno how to do spotlights yet sorry.






"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Adding Lights in SED [Re: EvilSOB] #227188
09/13/08 01:55
09/13/08 01:55
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
Thats good but in my level no shadows are cast!!!

I've put the DYNAMIC CAST and SHADOW flags on for all entities, and the light in the picture is represented by a very badly drawn sprite!



If anyone knows how to make sprites really spritish (always pointing at camera) and how to sort out additive blending on them that would be ace to know too, as the ones im stuck with are pretty crap!

Thanks!

Last edited by CdeathJD; 09/13/08 01:58.

I am a noob to this... Blitz3D is where i am best at!
Re: Adding Lights in SED [Re: CdeathJD] #227191
09/13/08 02:28
09/13/08 02:28
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I'll look into the lighting.

In the meantime,
To make sprites STAY facing the camera, set its pan & tilt to zero and leave them there.
To additive blend sprites, play with its BRIGHT, TRANSLUCENT flags and its .alpha settings.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Adding Lights in SED [Re: EvilSOB] #227193
09/13/08 03:30
09/13/08 03:30
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Found the lighting issue.
Create a new global material with
Code:
MATERIAL* mat_dynamic = 
{
   ambient_blue = 20;     //unlit brightness
   ambient_green= 20;     //unlit brightness
   ambient_red  = 20;     //unlit brightness
   emissive_blue = 200;     //lit responsiveness
   emissive_green= 200;     //lit responsiveness
   emissive_red  = 200;     //lit responsiveness
}
and apply it to all the entities you want to be lit with dynamic lights.
Attach the material like so
...
ENTITY_NAME = ent_create(blah blah blah);
ENTITY_NAME.material = mat_dynamic;
...

This will get you started. Play with the material properties to learn more.
Call the material whatever name you want.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Adding Lights in SED [Re: EvilSOB] #227224
09/13/08 11:09
09/13/08 11:09
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
Originally Posted By: EvilSOB
I'll look into the lighting.

In the meantime,
To make sprites STAY facing the camera, set its pan & tilt to zero and leave them there.
To additive blend sprites, play with its BRIGHT, TRANSLUCENT flags and its .alpha settings.


Yes i managed to get it working using d3d_alpharef = 255; its quite fait though!

I also set the sprites pan and tilt to zero but it only follow the camera round in the x and y dimensions.... if i go above it it doesn't "look up" at me!

I also implemented the material code as you suggested, but can't actually see any difference, and certainly no shadows drawn on the red landscape!


I am a noob to this... Blitz3D is where i am best at!
Re: Adding Lights in SED [Re: CdeathJD] #227347
09/13/08 21:37
09/13/08 21:37
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Damn, my bad again, for the blocks to cast shadows,
each of the entities needs a set(EntityName,CAST); as well.

Are you using the new material on the terrain too? Cause you need to.

I'll look at the sprite rotation. Ive never tried going above before.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Adding Lights in SED [Re: EvilSOB] #227352
09/13/08 21:52
09/13/08 21:52
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
I'm using cast on all entities, but its not working. Unless i have to set each flag with a seperate command - i've been adding them up with the "|" operator.


I am a noob to this... Blitz3D is where i am best at!
Re: Adding Lights in SED [Re: CdeathJD] #227368
09/14/08 01:25
09/14/08 01:25
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Adding them with the '|' is ok, but Ive sometimes seen it not work if there is any spaces
between the flag names and the '|'. eg VISIBLE|CAST = ok , VISIBLE_|_CAST = bad.
But only sometimes...

You didnt clearly answer if you are setting the new material to the terrain too?
(no shaders on the terrain I assume) And remember this is just for testing at this time.

Have the material changes youve done so far made ANY visual change? If so, what? (screencap?)

Havent got to looking at sprites yet. But check that they're pan,tilt & roll are all zero.

{EDIT}
Done the checks, My bad again, has to be pan=0, tilt=0, and ROLL = 1 to get above alignment on sprite.

Also be aware, having an alpha channel in the texture of your entities,
most commonly done by using TGA textures, causes lighting issues I cant explain,
because I havent figured it out yet. Im leaving that Brainbuster for another day.


Last edited by EvilSOB; 09/14/08 07:16. Reason: Testing complete, awaiting further feedback

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Adding Lights in SED [Re: EvilSOB] #227526
09/14/08 20:53
09/14/08 20:53
Joined: Aug 2008
Posts: 55
United Kingdom
CdeathJD Offline OP
Junior Member
CdeathJD  Offline OP
Junior Member

Joined: Aug 2008
Posts: 55
United Kingdom
Lol

* the entities dont use textures,
* the landscape isn't a landscape just a flat cube,
* the material makes no apparent changes.
* i've removed spaces from between the SET flags

still no shadows!

BUT ON THE PLUS POINT!

the sprite trick worked!

But i was somewhat horrified to find that if you use more than 1000 entities (sprites) then the engine REALLY slows down, and if you can make it to 2000 then you dont seem to be in for a good framerate!


I am a noob to this... Blitz3D is where i am best at!
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1