Weird drawing problem.

BlitzMax Forums/BlitzMax Beginners Area/Weird drawing problem.

Galdy(Posted 2014) [#1]
I'm experiencing a weird lightening effect on the door jams in my dungeon crawl. The door jams should be a pretty dark cast iron black. See the first pic. When I get further away the door jams lighten up. I can't figure out why. See second pic. I'm just using 2d commands. No opengl lighting effects or anything.






Kryzon(Posted 2014) [#2]
If these are static images then the problem was introduced by the software that generated them.

BlitzMax would only be displaying them as they are.


col(Posted 2014) [#3]
Hiya Galdy,

The colour of the jams is actually the same in both images, including the door on the left of the bottom image - I grabbed these images and cut out the areas for all 3 door jams and put them side by side. What you see is an optical illusion. The walls around the door jams get darker but the door jams themselves stay the same as they were.

If these are pre-rendered images then check the properties of the door jams in the render software - its as though theyre not being included in the lighting algo for some reason.


Galdy(Posted 2014) [#4]
The door jam files do not look like that after rendering or if viewed in say gimp for instance. I'm baffled. Here is the very image itself that Bmax is loading. PNG file.




Galdy(Posted 2014) [#5]
Col, An optical illusion? That's interesting.


col(Posted 2014) [#6]
Uh huh,
an optical illusion it is - even more than you think! as in fact the top image is slightly lighter than the lower 2 door frames!

Also the 2nd image with the 2 doors, the jams match EXACTLY the same colour(s) as your image in #4.

Strange effect eh.


Galdy(Posted 2014) [#7]
Thanks for bringing that to my attention. I was pulling my hair out trying to figure out what the -- was causing it. Saved me any further rabbit trailing. lol. I will actually have lit walls near any door, so that may bring it back into normal parameters.


Floyd(Posted 2014) [#8]
The way surrounding colors change your perception is astounding.

On this cube the top-center tile, apparently dark brown, and the front-center tile, which looks dark yellow, are the same color.
They both match the isolated light brown tile at the bottom.




Yan(Posted 2014) [#9]
People are often under the, mistaken, impression that we see with our eyes.


Galdy(Posted 2014) [#10]
lol


ImaginaryHuman(Posted 2014) [#11]
Could it be the mipmaps downsampling the texture and averaging texel colors?


Derron(Posted 2014) [#12]
I thought of the mipmaps at first too - but as col stated: he grabbed both images and they have the same "brightness": so it seems to be an optical illusion - but based on the mistake of "darkening the surroundings without darkening the center too".


bye
Ron


Kryzon(Posted 2014) [#13]
That cube image is probably the best illustration of the phenomenon that I have seen to date. The brown tones feel very different.


Floyd(Posted 2014) [#14]
I just remembered the motion equivalent of this.

Long ago there was a "bug report" about animation slowing down. This referred to the Blitz3D sample program in samples\mak\dragon. If you run this full-screen (windowed is WAY too fast) you will see the dragon moving at a modest rate. Now hold down the left or right arrow key. The entire scene spins and animation slows to a craw, apparently. That's an illision. It hasn't really changed at all. But with the whirling background the dragon seems much slower.


Kryzon(Posted 2014) [#15]
I found another example of the color illusion:



http://gurneyjourney.blogspot.com.br/2010/01/color-constancy.html


Floyd(Posted 2015) [#16]
Looking around for some old files I found something I had long forgotten. It's the brightness version of the color illusion in this thread.

It's not so hard to believe now that these look different. What I find remarkable is that the two squares are so close and the brightness appears to simply alternate light and dark on adjacent squares. Yet in the short trip from A to B our mental estimate of light and dark has flipped.





Takis76(Posted 2015) [#17]
You have made perfect work here.
Is your dungeon 3D or 2D (Rendered images) any demo or video to see.
See my Eye of the Beholder IV video too:

https://www.youtube.com/watch?v=-siQzBA24EQ

About your lighting when you are far from the door , you see the doors like self illuminated.
If your graphics are 2D the you just reduce the gama correction of your images , make the doors darker when they are far. They looks like to be illuminated because the whole environment is very dark and the texture of the door have higher colors.
If you want to make your door darker , reduce the brightness or the gama correction lower than the whole environment.

See my example of my game.






Galdy(Posted 2015) [#18]
Hello Takis76, That looks great! Nice work! Those type of games are what inspired me. Yes it's rendered 2d. I haven't touched the project in over a year sad to say. I'll try to cook up a demo sometime for you. It is nowhere near as finished as yours. You can move around in the dungeon and I have has some torch particle effects functioning. That's about it.I have a MaxGui Dungeon editor I've developed along side with it. It's been a blast working on and learning Bmax. Maybe with some down time this winter I can move it forward.