[Programming] Halp with Lumin brightness.

Forum for alternative clients, mods & discussions on the same.

Moderator: Phades

[Programming] Halp with Lumin brightness.

Postby Oddity » Sun Aug 17, 2014 8:39 pm

I need to mod the client's Lumin object, but the whole rendering thing is too complicated for me to understand without diving into it deeper.

Currently, this is how bright a single object with a Lumin is (in pitch darkness):

Image

On the right side of the picture, you can see how bright a second Lumin overlayed over the first one is.

I want a single Lumin to look more like maximum daylight brightness:

Image

Currently, stacking a whole bunch of Lumins on top of each other just gives me this:
Image

Been playing around with ILM.java for a while, but haven't managed to get the effect I want yet.
jadamkaz wrote:ah i remember my run in with odditown they are good ppl im sure the only reason they killed ME is because they are troll hunters and i was a troll
User avatar
Oddity
 
Posts: 1950
Joined: Sun Jun 20, 2010 12:04 am
Location: BC, Canadia

Re: [Programming] Halp with Lumin brightness.

Postby Xcom » Mon Aug 18, 2014 2:28 pm

If I get bit of breeding room from uni I'll give it a go. Hope it wont be to late by then.
User avatar
Xcom
 
Posts: 1105
Joined: Wed Dec 14, 2011 1:43 pm

Re: [Programming] Halp with Lumin brightness.

Postby Oddity » Mon Aug 18, 2014 6:08 pm

I can get the desired shape by changing the ILM.java static block to this:
Code: Select all
static {
   int sz = 400;
   BufferedImage lb = new BufferedImage(sz, sz, BufferedImage.TYPE_INT_ARGB);
   Graphics g = lb.createGraphics();
        Color c = new Color(255, 255, 255, 128);
        g.setColor(c);
        g.fillOval(0, 0, sz, sz);
   ljusboll = lb;
    }


But playing with the color values hasn't helped me change the amount of brightness per Lumin mask. :(
Image

The maximum brightness I can attain with repeated Lumins is also rather low still:
Image
jadamkaz wrote:ah i remember my run in with odditown they are good ppl im sure the only reason they killed ME is because they are troll hunters and i was a troll
User avatar
Oddity
 
Posts: 1950
Joined: Sun Jun 20, 2010 12:04 am
Location: BC, Canadia

Re: [Programming] Halp with Lumin brightness.

Postby boshaw » Mon Aug 18, 2014 7:33 pm

You adjust the ambient color of ILM
User avatar
boshaw
 
Posts: 1538
Joined: Tue Jun 01, 2010 10:22 pm

Re: [Programming] Halp with Lumin brightness.

Postby Nummy » Mon Aug 18, 2014 10:00 pm

Image

Here is your solution m8. Just reverse color or blending and you should be fine. Dark outside and bright inside :)
User avatar
Nummy
 
Posts: 489
Joined: Sat Mar 19, 2011 10:01 am

Re: [Programming] Halp with Lumin brightness.

Postby Oddity » Tue Aug 19, 2014 2:05 am

Nummy wrote:Dark outside and bright inside :)

Yeah, got that part figured out. But I can't get it to be as bright inside the circle as maximum daylight (eg. if you have nightvision enabled). Even if I overlay 1000 of them on top of each other, it still won't be very bright (and I'd like to just have a single Lumin object be that bright — perhaps with adjustable strength as the Lumin object would lead you to think is possible).

Current max brightness with a size of 400: http://puu.sh/aYoBv/d7f0d2f5bf.jpg
jadamkaz wrote:ah i remember my run in with odditown they are good ppl im sure the only reason they killed ME is because they are troll hunters and i was a troll
User avatar
Oddity
 
Posts: 1950
Joined: Sun Jun 20, 2010 12:04 am
Location: BC, Canadia

Re: [Programming] Halp with Lumin brightness.

Postby Oddity » Tue Aug 19, 2014 2:09 am

boshaw wrote:You adjust the ambient color of ILM

You mean this line?

Code: Select all
amb = new Color(0, 0, 0, 0);


Thoroughly playing around with its values didn't have any effect.
jadamkaz wrote:ah i remember my run in with odditown they are good ppl im sure the only reason they killed ME is because they are troll hunters and i was a troll
User avatar
Oddity
 
Posts: 1950
Joined: Sun Jun 20, 2010 12:04 am
Location: BC, Canadia

Re: [Programming] Halp with Lumin brightness.

Postby boshaw » Tue Aug 19, 2014 4:54 am

Oddity wrote:
boshaw wrote:You adjust the ambient color of ILM

You mean this line?

Code: Select all
amb = new Color(0, 0, 0, 0);


Thoroughly playing around with its values didn't have any effect.



That's because amb is set to the glob.amblight everytime MapView is drawn which changes based on what you send to the client through the server.

but as Nummy said you basically have to get the blending right so that the dark areas stay dark but the areas that should be lit up are brighter (aka: more transparent so that it doesn't block out the tiles/objs drawn below it)
User avatar
boshaw
 
Posts: 1538
Joined: Tue Jun 01, 2010 10:22 pm

Re: [Programming] Halp with Lumin brightness.

Postby Oddity » Wed Aug 20, 2014 2:02 am

boshaw wrote:but as Nummy said you basically have to get the blending right so that the dark areas stay dark but the areas that should be lit up are brighter (aka: more transparent so that it doesn't block out the tiles/objs drawn below it)

I'm not even sure where to start. I might have to learn a bunch of OpenGL and study loftarb's rendering pipeline unless somebody can help me out. :P
jadamkaz wrote:ah i remember my run in with odditown they are good ppl im sure the only reason they killed ME is because they are troll hunters and i was a troll
User avatar
Oddity
 
Posts: 1950
Joined: Sun Jun 20, 2010 12:04 am
Location: BC, Canadia


Return to The Wizards' Tower

Who is online

Users browsing this forum: No registered users and 8 guests