Jump to content

Additional lighting in engine


Recommended Posts

  On 26/06/2018 at 9:04 PM, vladislavbelov said:

The lights can't throw shadows, because performance (we can implement it, but only few powerful videocards can handle it).

Expand  

"Ultra" Option maybe ?

  On 26/06/2018 at 9:04 PM, vladislavbelov said:

There can't be many light sources in one place (at least for low videocards and since we don't support deferred rendering). Because shaders have own restrictions, particularly uniform sizes. But probably it's not the real problem.

Expand  

Well it looks already gorgeous with the campfires.

 

  On 26/06/2018 at 9:04 PM, vladislavbelov said:

So I have a question: do we need additional light sources in near releases? Would it be real useful?

Expand  

Why not ? Do you have a patch somewhere

@aeonios Ping

 

  On 26/06/2018 at 9:04 PM, vladislavbelov said:

P.S. I found strange normal values for some model, it should be investigated (probably the shader problem).

Expand  

Which one ?

  • Like 2
Link to comment
Share on other sites

  On 26/06/2018 at 10:32 PM, stanislas69 said:

"Ultra" Option maybe ?

Expand  

Yes, please. Don't automatically nerf graphics options just because not everyone can see them (yet). I remember a time when the team poo pooed the idea of normal maps or even self-shadowing (!).

 

Another thing we need is lighting conditions to affect particles correctly, such as smoke and dust. 

Edited by wowgetoffyourcellphone
  • Like 1
Link to comment
Share on other sites

  On 27/06/2018 at 7:05 AM, wowgetoffyourcellphone said:

Don't automatically nerf graphics options just because not everyone can see them (yet).

Expand  

IMO, I don’t see a reason as to why the capabilities of the engine should be held back just because there maybe people who can’t run it.

Keeping features like this one as an option would give users with high-end machines a chance to enjoy them while at the same time others could still enjoy the game.

The awesome graphics capabilites of Pyrogenesis is a huge plus point for it and I guess it wont hurt to have more ;)

Link to comment
Share on other sites

  On 26/06/2018 at 10:32 PM, stanislas69 said:

"Ultra" Option maybe ?

Expand  

Of course as option :) I'm mostly interested, is it useful without shadows for artists/modders?

  On 27/06/2018 at 3:17 AM, Trinketos said:

maybe the alpha 24 is the last alpha that my pc cant run :(

Expand  

It'd be as option, so you'd can disable it.

  On 27/06/2018 at 7:04 AM, wowgetoffyourcellphone said:

So, if we get glow maps implemented we can have light sabers. Nice. :D 

Expand  

It's a little bit different technique, the glow effect can exist without lightings.

  On 26/06/2018 at 10:32 PM, stanislas69 said:

Do you have a patch somewhere

Expand  

Yep, but it requires the refactoring as I mentioned. So you could test my phab patches to accelerate this implementation :)

  On 26/06/2018 at 10:32 PM, stanislas69 said:

Which one ?

Expand  

You may notice it on clothes on sticks near the bottom house of 2.

  • Like 1
Link to comment
Share on other sites

  On 27/06/2018 at 7:08 PM, Lion.Kanzen said:

Can be nice try to Hyrule conquest such feature, a game with magic can need it.

  Reveal hidden contents

 

Expand  

it definitely will for Gohma (eg. eggs, glowing eyes ...) and other civs, which means it would be useful to be able to make settings for this in Atlas editor such as brightness or where to attach it ... 

  • Like 2
Link to comment
Share on other sites

  On 29/06/2018 at 3:54 PM, aeonios said:

Forward+ could work but I'm pretty sure that requires openGL 3.x.

Expand  

Nope, it doesn't need it.

  On 29/06/2018 at 3:54 PM, aeonios said:

0ad's art heavily uses transparency so deferred rendering isn't an option.

Expand  

The deffered rendering can be easily used with transparent objects too.

Link to comment
Share on other sites

  On 03/07/2018 at 11:16 PM, vladislavbelov said:

Nope, it doesn't need it.

Expand  

Eh, if you want more than a couple of lights then you do. I don't know if it absolutely needs openGL3.x but it does need to do some fancy data structure access in order to know which lights it needs to draw and to access the data for those lights. I don't know how all of that works unfortunately, and it seems to be more complicated to code than deferred rendering is.

  On 03/07/2018 at 11:16 PM, vladislavbelov said:

The deffered rendering can be easily used with transparent objects too.

Expand  

Sure, except that they won't be lit by dynamic lights at all, which would look really bad given the amount of transparency used in 0ad. Trees, bushes, even things like shields would stand out like a sore thumb. Everything under water as well. Forward+ would allow everything to be lit dynamically, deferred would not.

  On 03/07/2018 at 11:18 PM, vladislavbelov said:

Another using of lightings:

lightning.gif

Expand  

That is pretty cool. Lightning looks kinda bad without dynamic shadows though. :(

Link to comment
Share on other sites

Same question here, how is the rain implemented? (As the camera isn't moving it could also be a single 2D texture cheat)

The rain we currently have is extremely low performant and rotates with the camera tilt which is incorrect as mentioned by wow.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  On 03/07/2018 at 11:29 PM, wowgetoffyourcellphone said:

Awesome! Are you working on rain effects too? Those raindrops seem to be falling correctly, not like they do now. 

Expand  

Currently I'm trying to add features that popular in modern engines and liked by players to find different implementation bottlenecks in our code.

  On 03/07/2018 at 11:51 PM, aeonios said:

Eh, if you want more than a couple of lights then you do. I don't know if it absolutely needs openGL3.x but it does need to do some fancy data structure access in order to know which lights it needs to draw and to access the data for those lights. I don't know how all of that works unfortunately, and it seems to be more complicated to code than deferred rendering is.

Expand  

Yes, I mentioned, that it doesn't support many lights per model. Usually video card can support from 8 to 128 lights per model. It uses simple uniform structs (even not UBO).

// 8 floats per struct.
struct PointLight
{
	vec3 position;
	float radius;
	// vec2 - compressed 4 components, instead of unsupported "half".
	vec2 color;
	vec2 coef; // Cubic curve coef.
};

So we can calculate how many lights we can use from GL_MAX_FRAGMENT_UNIFORM_COMPONENTS.

  On 03/07/2018 at 11:51 PM, aeonios said:

Sure, except that they won't be lit by dynamic lights at all, which would look really bad given the amount of transparency used in 0ad. Trees, bushes, even things like shields would stand out like a sore thumb. Everything under water as well. Forward+ would allow everything to be lit dynamically, deferred would not.

Expand  

There're 2 import notes: 1) we can use forward and deferred rendering simultaneously (i.e. for different distance), 2) as you noticed we don't have a lot of semitransparent objects; trees, bushes have transparent only for soft edges, so on enough distances we can render them without alpha blending and they're not transparent objects anymore (we don't need to be honest for rendering always; if it looks the same/very similar but cheaper, then we'd can use the cheaper one).

  On 03/07/2018 at 11:51 PM, aeonios said:

That is pretty cool. Lightning looks kinda bad without dynamic shadows though. :(

Expand  

If we assume that we don't have a sun at rain, then we'd easily add shadows to the lightnings :)

  On 04/07/2018 at 1:49 AM, Trinketos said:

Weather confirmed?

Expand  

Nope (at least not yet). It'd be confirmed when it'll be in the our main repository :)

  On 04/07/2018 at 12:03 PM, elexis said:

Same question here, how is the rain implemented? (As the camera isn't moving it could also be a single 2D texture cheat)

The rain we currently have is extremely low performant and rotates with the camera tilt which is incorrect as mentioned by wow.

Expand  

It uses 2D rain texture (drawn by me in Ps for 5 mins :D) on many long crosses with double side rendering (because many particles would be slow). They're not moving when the camera is moving. So it seems a correct rain. Current implementation doesn't use shaders yet, but with shaders it can be a little bit nicer.

  • Like 4
Link to comment
Share on other sites

  On 05/07/2018 at 11:23 AM, vladislavbelov said:

It uses 2D rain texture (drawn by me in Ps for 5 mins :D) on many long crosses with double side rendering (because many particles would be slow). They're not moving when the camera is moving. So it seems a correct rain. Current implementation doesn't use shaders yet, but with shaders it can be a little bit nicer.

Expand  

Can you make this a separate patch ? The best way, would be a simulation triggerable version of it :) But a map specific one is fine too.

  • Like 1
Link to comment
Share on other sites

  On 05/07/2018 at 11:23 AM, vladislavbelov said:

There're 2 import notes: 1) we can use forward and deferred rendering simultaneously (i.e. for different distance), 2) as you noticed we don't have a lot of semitransparent objects; trees, bushes have transparent only for soft edges, so on enough distances we can render them without alpha blending and they're not transparent objects anymore (we don't need to be honest for rendering always; if it looks the same/very similar but cheaper, then we'd can use the cheaper one).

Expand  

That's not actually true. Most of the foliage uses transparency not only for soft edges but also to blend with terrain and other foliage behind. I messed around with foliage a bit and found that the bleed-through effect was much more prominent than the soft-edge effect (which doesn't seem to be used particularly well at all). Fixing all of the art to use alpha test would take a lot of work and the results might be questionable.

  On 05/07/2018 at 11:23 AM, vladislavbelov said:

It uses 2D rain texture (drawn by me in Ps for 5 mins :D) on many long crosses with double side rendering (because many particles would be slow). They're not moving when the camera is moving. So it seems a correct rain. Current implementation doesn't use shaders yet, but with shaders it can be a little bit nicer.

Expand  

Particles can be fast but you have to use drawinstanced and geometry shaders, which are GL3.

Link to comment
Share on other sites

  On 05/07/2018 at 1:44 PM, aeonios said:

That's not actually true. Most of the foliage uses transparency not only for soft edges but also to blend with terrain and other foliage behind. I messed around with foliage a bit and found that the bleed-through effect was much more prominent than the soft-edge effect (which doesn't seem to be used particularly well at all). Fixing all of the art to use alpha test would take a lot of work and the results might be questionable.

Expand  

The terrain isn't transparent and blending doesn't make sense after the blending is done (especially on long distances), so there is no problem with it. Yes, it requires a work, but it's simple.

  On 05/07/2018 at 1:44 PM, aeonios said:

Particles can be fast but you have to use drawinstanced and geometry shaders, which are GL3.

Expand  

True, as the tessellation one :) But it's the another level. It can't be faster than simple quads with a texture. But it can be nicer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...