Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 722 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
sun and dynamic light? #446728
10/29/14 11:27
10/29/14 11:27
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I wonder is there any way to get brightness of the surface affected by dynamic light and sun light. F.e. if I trace below player and then check for tex_light (or hit) I can see then, if player is hiding in the shadow or not (lightmap), this could be used to make view entity darker or brighter depending on the surface below player (lets call this fake lightning). I remember one guy from Russian gamestudio community (jd_frost) used view entities for weapons, and via some tricks he was able to get dynamic lights with their colors (sun light as well) affect on view entity, and he didn't use shaders for those, only a trace, some stuff that I do not remember, and he changed view entities colors (I remember this one for sure). The sad thing is, that Russian community webpage is down.. maybe some of you guys have an idea how to return color and brightness of surface affected by dynamic light?

thanks in advance, greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: sun and dynamic light? [Re: 3run] #446740
10/29/14 17:04
10/29/14 17:04
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You could try to iterate over the level enemies (ent_next), find those who have light_range != 0 or whatever it is called, then perform a c_trace every frame or multiple times per second from the camera to those entities (distance checks/ updates every frame, they are relatively cheap) and try to adapt the view entity color that way.
You could either use a shader or use a simple and old school MATERIAL where you set material.ambient_red, material.emissive_red and so on manually. I'm not too sure about the correct formula right now but for a start try to set the emissive_blue vector to zero each frame, then add the light (ent.blue ?) of each visible dynamic light source to said material vector but scale it prior to that with some factor like the following:

factor = clamp(1-vec_dist(camera.x,light.x)/light.light_range,0,1);


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: sun and dynamic light? [Re: Superku] #446744
10/29/14 21:19
10/29/14 21:19
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
well, I've got your idea. thank you, Superku.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: sun and dynamic light? [Re: 3run] #446760
10/30/14 10:56
10/30/14 10:56
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
wouldn't it be better to use normal models for weapons placed farer than clip_near instead of view entities? you could get much quality, just by using a bit longer 1st person arm model, and weapon model with adjusted scale; and another different model, if you want to switch to 3rd person view.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: sun and dynamic light? [Re: sivan] #446762
10/30/14 11:36
10/30/14 11:36
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
You can even use only one model for first and third person. It works pretty fine and has some really cool dynamics as the weapon is animated through the player model.
Also you could see your feet wink


Visit my site: www.masterq32.de
Re: sun and dynamic light? [Re: MasterQ32] #446763
10/30/14 11:48
10/30/14 11:48
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
yeah and because of shadows cast by player character it is better... if close clipping issues are solved.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: sun and dynamic light? [Re: MasterQ32] #446772
10/30/14 13:54
10/30/14 13:54
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I'm doing this for testing purposes, not because I prefer view entities over world entities for weapons, or so. And I don't really need anyone to tell about what looks better, cause we all do have our own tastes tongue
Originally Posted By: MasterQ32
Also you could see your feet wink
This doesn't make your approach better, cause if you won't have good animated models, it will look terrible (I've already told you this before, when you've showed me one of your projects WIP). In my situation, I have no good models, and I'm not the one who can create good ones, so tongue

Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: sun and dynamic light? [Re: 3run] #446773
10/30/14 14:09
10/30/14 14:09
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Quote:
This doesn't make your approach better, cause if you won't have good animated models

Doesn't this also apply on view models as you can see the models in third person (as the player you see your enemies)
So imho it doesn't matter if i see "one more" bad animation if most of the animation is bad.


Visit my site: www.masterq32.de
Re: sun and dynamic light? [Re: MasterQ32] #446774
10/30/14 14:11
10/30/14 14:11
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Originally Posted By: MasterQ32
Doesn't this also apply on view models
It doesn't, simply cause I use animated sprites instead of models tongue
And there are tons of pretty nice animated (old-school) sprites out there!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: sun and dynamic light? [Re: 3run] #446775
10/30/14 14:59
10/30/14 14:59
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Why not use a PANEL with the animated weapon sprite and color it dynamically with LIGHT flag and use this instead of a view model?
Should look pretty cool if the NOFILTER flag is set


Visit my site: www.masterq32.de
Page 1 of 2 1 2

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

Gamestudio download | chip programmers | 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