Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Aug 2009
Offline Last Active Apr 13 2016 08:44 AM

Posts I've Made

In Topic: I'm building a photonmapping lightmapper

13 April 2016 - 08:45 AM

Ok little report from the front.

I figured that one big problem I have is a problem of precision during reconstruction of the 3d position from the lumel position.

I have a bad spatial quantization, using some bias helped remove some artefacts, but the biggest bugs arn't gone.


anyway, some results applied to real world maps show that indirect lighting shows and makes some amount of difference:


(imgur album)










In Topic: I'm building a photonmapping lightmapper

30 March 2016 - 07:36 AM

Awight, there we go, the drawing:



Ok so with this, it's much clearer I hope, the problem is by what figure should I be diving the energy gathered at one point ?

The algo works this way:

first pass is direct lighting and sky ambient irradiance.

second pass creates photons out of the lumels from the first pass.

the third pass scans the lightmap lumels and do the final gather.

The gather works by sending 12 primary rays, finding k-neighbors from the hit position, tracing back to origin and summing Lambertians.

Normally one would think we have to divide by number of samples, but the samples can vary according to photon density, and the density is not significant because I store a color in them. (i.e. their distribution is not the mean of storing the flux like in some implementations)

Also, the radius depends on the primary ray length, which means more or less photons will be intercepted in the neighborhood depending if it hits close or far. And finally the secondary rays can encounter occluders, so it's not like it will gather N and we can divide by N. If we divide by the number of rays that arrive at the origin, we are going to have an unfair energy boost.

I tend to think I should divide by the number of intercepted photons in the radius ?


Edit: that's the photon map visualizer. I made so that colors = clusters.


In Topic: for each in: Pythonic?

05 August 2015 - 09:04 AM


I was wondering if each would be good if the list had various data types

If your list contains multiple, non-polymorphic datatypes, then you are doing something evil (or spent too much time in LISP).


Edit: just to clarify, a list containing multiple, non-polymorphic datatypes is almost impossible to operate on idiomatically. You are forced to either know the exact type and order of each element ahead of time (in which case a tuple would be more appropriate), or fallback to a chain of if insinstance(a, Foo): else: statements, which is just bad software design.


Certainly not. python can work on different types just like some kind of type erasure system. they are not polymorphic but some operations can apply to a whole variety of types. This is the same than working against the highest interface in OOP. In python you can do it too without any contracts.

take a look at that : http://lucumr.pocoo.org/2011/7/9/python-and-pola/

There is not even a mention of classes and inheritance and yet python can accept code that is even more powerful than multiple inheritance, because you can work against "operators" (c.f `len` example in the link). If you keep that in mind as a discipline when writing functions, you open your possible accepted types to a larger variety.

In Topic: Which version should I choice to build my ocean?

05 August 2015 - 08:43 AM

You don't want to write half a page because .... you are lazy ?

It will be tough implementing a nice ocean system if you are that lazy.

Choose, either you don't care about sharing what you do, or you care and you write your half page. Half a page is nothing, read at least the papers you linked, how many pages do they have ? how many months you think it took those researchers to do their work AND cherry on top, write about it and share it publicly ?

Meanwhile, what are you doing ?

In Topic: Default values for members in an anonymous struct inside a class

18 July 2015 - 10:34 AM

yes report quickly because its going to get out soon, and ms implementation of C++11 seems to already have enough basic bugs like that on its record.

I reported one myself. seems like they have a poor test suite, or/and just few users really using their soft.