Author Topic: Broken light in software mode  (Read 4583 times)

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Broken light in software mode
« on: September 26, 2010, 06:51:17 am »
So I was trying out my new obj cave model but when I loaded the textures, things really got messy. But when I used hardware mode everything was fine again. Bug? solutions?

Software mode:


Hardware mode:



Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Broken light in software mode
« Reply #1 on: September 26, 2010, 10:04:28 am »
Are these polygons just black or are they missing at all? Any unusual log messages?

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Broken light in software mode
« Reply #2 on: September 26, 2010, 11:20:38 am »
Just black. I seem to found the issue. It only happens when I turn on mipmapping.
No unusual messages that I can see.

I could send over the model if that helps you solve it.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Broken light in software mode
« Reply #3 on: September 26, 2010, 02:44:34 pm »
Yes, models and textures please. Seems to be a problem in software renderer's mipmap generation or calculation code then.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Broken light in software mode
« Reply #4 on: September 27, 2010, 10:13:11 pm »
...still waiting for the model... ;)

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Broken light in software mode
« Reply #5 on: September 27, 2010, 10:44:14 pm »
Sorry I been busy, been meaning too. I'll upload it after work today.

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Broken light in software mode
« Reply #6 on: October 02, 2010, 03:09:17 am »
Sorry for the delay. Have too much to do lately.

Here's the files.
http://www.mediafire.com/?damm6rkqlatqp2m

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Broken light in software mode
« Reply #7 on: October 02, 2010, 05:20:40 pm »
Can't access it, it's set to private... :(

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: Broken light in software mode
« Reply #8 on: October 03, 2010, 03:30:07 am »
Woops, sorry about that. Try now.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Broken light in software mode
« Reply #9 on: October 04, 2010, 08:55:27 pm »
The download works fine now. However, i can't verify the problem. Everything works as expected in my tests. But it may be caused by the size of those textures. They are 2048*2048. which is huge. Creating mip maps for these beats requires some memory, because it creates a new image from the pixel data (which is 16mb for one texture alone), i.e. 16 mb pixel data + 16mb image + the scaled instances and the pixel data of those leads to some serious memory usage. Maybe it's running into an OutOfMemory-Exception that somehow gets swallowed by your code leaving the generated mip maps in some in-between state.

BTW: 2048*2048 is pretty huge anyway. It will cause bad performance of the software renderer due to cache misses and it's not cheap on slower hardware either. Consider using a reduced version of the textures.

 
« Last Edit: October 04, 2010, 09:00:08 pm by EgonOlsen »