About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Issues with Lighting and UI
Author Message
dylantan Offline
Member

Post: #1
Issues with Lighting and UI
Hello everyone

I am having this weird issues which I could not figure out what to do. The following is our issues:

1. Dual Lighting can be seen in the scene. When we move the character just a little, you can see 2 different ambient in the scene (even when the character are not moving). We do have some secondary lighting (light cone) in the world map and this is one of the things that affect the scene for sure but my question is how can we solve this issue?
   

2. UI Scaled down when going higher resolution. This have been an headache for us for quite sometime now. My question is, how can we make the UI and its image retain its pixel even if the screen resolution changed?
   

Any tips, and advice are very much appreciated. Thank you in advance grin
07-06-2013 05:38 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Scarlet Thread Offline
Member

Post: #2
RE: Issues with Lighting and UI
Hi,

I don't know how to solve 1... but

In 2: The GUI scale is based on proportions as you may know.. This problem occurs when you change the aspect ratio of the screen not the size necessarily.

You need to calculate an xy scaling Vec2 that when multiplying with the GUI's box scale and coordinates makes the scale correct for that aspect ratio. This scaling value must be calculated from the new screen aspect based on the native screen aspect (i.e. the maximum size the game is designed for example 16:9)... always base the scale of your box's x and y by the only the x coordinate of the screen because it will always be greater than the y. and if you scale x by x and y by y your GUI will stretch.

You will also have to scale your positions.. scale x positions by the x scaling value and y positions by the y position at least most of the time. Sometimes you will have to scale y positions by the x scaling value depending on the situation.

That being said your y scaling value is always 1.0 unless your game has a greater y resolution than x which would be awfully weird.

ScaleingVector = Vec2(D.aspectDisplay() / (nativeSize.x/nativeSize.y), 1.0f);

recalculate this value every time you change resolution and at the start of the game.. then you have to go through all your GUI objects and scale their boxes accordingly

Hope that helps. You will probably need to fiddle around with it a fair bit.

Edit: Maybe there is an easier built into esenthel to do this but I'm not aware of it. this is how I do it.
(This post was last modified: 07-06-2013 06:48 AM by Scarlet Thread.)
07-06-2013 06:44 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #3
RE: Issues with Lighting and UI
(07-06-2013 06:44 AM)Scarlet Thread Wrote:  Edit: Maybe there is an easier built into esenthel to do this but I'm not aware of it. this is how I do it.

static void ScreenChanged(Flt old_width, Flt old_height){/* do change here*/}
D.screen_changed=ScreenChanged;

this helps alot when rescaling/changing resolution at runtime.
(This post was last modified: 07-06-2013 07:42 AM by Zervox.)
07-06-2013 07:36 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Issues with Lighting and UI
2) to have the same per-pixel scaling you can do something like this:
Code:
void ScreenChanged(Flt old_width=0, Flt old_height=0)
{
   D.scale(800.0f/D.y());
}

1)
a) on which platforms does this occur - win(dx9/dx10+) / mac?
Can you test all of the following and check if it makes the issue disappear:
b) Renderer.allow_glow=false;
c) Sun.rays_mode=SUN_RAYS_OFF;
d) Sun.image=NULL; (completely turning off the sun)
e) D.ambientPower(0.0f);
f) D.hpRt(false);

Thanks
07-06-2013 12:22 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Issues with Lighting and UI
1) Thank you for reporting the issue, I've managed to find and fix the problem
It occurs only on OpenGL (Mac) if D.hpRt is enabled and glow is not visible on the scene.

This will be in the next release:
-fixed small issue of different bloom results for OpenGL if glow is on the scene or not (and D.hpRt is enabled)

If you have this problem in a different scenario, then please try doing things from my previous post.

Thanks
07-06-2013 01:36 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #6
RE: Issues with Lighting and UI
Good guy Esenthel: asks for more information to help with the issue - fixes the issue before he even reads the post.
07-06-2013 02:26 PM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #7
RE: Issues with Lighting and UI
We finally got the GUI Working as intended! Thank you everyone! Finally we got something nice to show. lol

As for Esenthel questions the following is the answer:

Quote:a) on which platforms does this occur - win(dx9/dx10+) / mac?
Answer: We using Windows 7 and this occurs in DX9/DX10.

Quote:Can you test all of the following and check if it makes the issue disappear:
b) Renderer.allow_glow=false;
c) Sun.rays_mode=SUN_RAYS_OFF;
d) Sun.image=NULL; (completely turning off the sun)
e) D.ambientPower(0.0f);
f) D.hpRt(false);
Answer: We tried all the above as you mentioned but no luck, the dual lighting still persisted.
(This post was last modified: 07-07-2013 01:57 PM by dylantan.)
07-07-2013 03:25 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: Issues with Lighting and UI
Hello,

Then it's possible that the issue is not related to the engine? Could you verify all of your codes related to changing bloom/ambient/sun/lights settings.
Perhaps you adjust the values somehow somewhere?

Can you reproduce the issue in any EE made demo/tutorial?
07-08-2013 08:58 AM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #9
RE: Issues with Lighting and UI
Actually we found the problem. It is actually related to how many lighting is permitted in one location/area. The lighting issues is due to, if more than 2x secondary light overlapped in 1 area/location and with the sun light included, it means within the same area/location there are 3 lights, the issues appear. By allowing only 2 lights in same location/area remove the problems but ....
07-10-2013 01:47 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
RE: Issues with Lighting and UI
Hi, the engine should work ok with any number of lights for deferred and forward renderers.
Unless you're using D.maxLight
If you think that there's some issue with the lights processing could you please attach a small project with the issues reproduced?
Preferably 2.0 project

Thank you
07-10-2013 11:48 AM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #11
RE: Issues with Lighting and UI
Hi Esenthel,

Not sure but we redo whole lighting again in the map, and based on what I mentioned earlier, we decided to only use max of 2 lights within a single area because we worried about creating more overlapping lights that might reproduce the issues. Although 2 lights only may not look good but at least solved the issues for now as we are rushing to complete the project and other issues now takes priority.

We have not move to EE 2.0 yet but I think we are likely to stick with EE 1.0 till the project completion as we are very comfortable working with EE 1.0 Editors and Toolset. EE 2.0 feel quiet different and we worried that if we change, it may also affect our progress and also we are already very far/deep in the project and don't want anything that might hinder our progress any further.

But I will see if I can reproduce the issues and forward to you.

(07-10-2013 11:48 AM)Esenthel Wrote:  Hi, the engine should work ok with any number of lights for deferred and forward renderers.
Unless you're using D.maxLight
If you think that there's some issue with the lights processing could you please attach a small project with the issues reproduced?
Preferably 2.0 project

Thank you
07-11-2013 01:30 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply