Jump to content

  • Log In with Google      Sign In   
  • Create Account

Vilem Otte

Member Since 11 May 2006
Offline Last Active Oct 23 2016 04:54 AM

Posts I've Made

In Topic: Planetary Shadows

09 October 2016 - 05:00 PM

What @JoeJ posted is correct, I'd extend his response with something interesting about the topic -> as you are working on planetary scale it might sound interesting to add general relativity context (allowing to F.e. simulate gravitational lensing and light-gravity interaction in general.


In reality even planets are generating some gravitational lensing - and therefore you are not actually going always along the line (as photon direction, frequency and therefore intensity are affected by gravity), although not even close to solar-scale (or bigger). It might be interesting to see such simulation on the surface of planet in binary/ternary star systems (Alpha Centauri AB for example).

In Topic: The Problem With Capitalism

03 October 2016 - 07:58 PM

If there is a legitimate bug, it can be fought. You should take the negative experience from post-comunist eastern block countries, where since money were baned and restricted, they became extremly "worshiped", anything is literaly marketed, everything reads only market bonity, and there is absence of charity in too big manner.


So my point was that restriction/limitation in earning money to dismiss their "power" is wrong.


I'm not sure how many of you lived through communism, although, comparing all the four -> nazi war-economy (which I remember only from talking with grandmother), communism, post-communism and capitalism...


War economy is not something even worth mentioning - as food was distributed per-person based on their nationality, age, etc. Work was mandatory and of course some just were straight put to prison (then to death), or directly to death.


Communism was, well, to put it correctly: "if it worked it would've been awesome." The point is, it was socialism (not Marx-based communism, which is utopia), whoever was in lead was very powerful and rich ... and everyone else had the same nothing (teacher, programmer, professor, doctor, ... all had same income that was enough for rented 50m^2 flat (for family - which means parents + children), and enough for food ... occasionally for holiday (you could visit mountains for trekking every weekend, once or twice a year go for holiday abroad (but only to East of course), when children grew up and finished school - they got their own flat). Of course if you were higher communist member you had more... literally everyone was lower communist member (out of 15 mil. people in Czechoslovakia, there were over 9 mil. in communist party ... you wanted to study, join commies... army was mandatory, and you had to of course, join commies, etc.). It wasn't like others say "you're not allowed to do anything what you want" - you were, but you had to join nationally-driven club for it. Nevertheless, it has its positives (getting flat right after study, without making yourself a slave for bank F.e.) and negatives (after all you couldn't say whatever was on your mind, it could get you to jail). Everything was overseen by by Moscow, everything what you could and couldn't do was dictated by Moscow.


Post-communism is something that unites all Czechs, Slovaks, Polish, Hungarians and others ... how to start it? The politicians promised us "no unemployed", "we will catch west in 5 years", etc. Of course those were lies. Anywhere on the west they looked at us like on beggars. If we wanted to work there, we were 2nd class (or better 3rd class) people, underpaid... All our pride (in Czech, our cars manufacturies, our beer breweries, our guns manufacturies, train manufacturies, etc.) were "privatized" (read ruined, stolen or just destroyed as business), so the same politicians that promised us those things basically right before our eyes stole everything ... nobody was punished. No pros here, only negative sides.


Then, after the country industries and agriculture was literally destroyed - we started re-building... while being a capitalism, we are also being strictly limited by EU (from the shape of bananas, through what lightbulbs you can use/make, up to the newest thing - what is standard equipment of new house, and what are acceptable topics to talk about (sport, etc.) and unacceptable (muslim immigration) ... okay Bruselles is a bit like Moscow in SSSR). With such regulations it is close to impossible to F.e. buy a house or flat after studies (3M CZK for house, while median income after taxes is what... 12k CZK (with age median income grows to ~16k CZK after 30 years of praxis) ~ so in 30 years if you don't eat or live anywhere, you can buy a house ... everything changes with education (being doctor, programmer, teacher etc. finally has a difference over a standard 'bus driver')) - still this is a lot worse compared to communism. On the other hand you can start a business and earn a lot more, which is better compared to communism. Are we living better? I would say so, although I and most my relatives have finished universities - therefore it is quite a difference.


While people with better life positions have it better, people who are just workers are actually living worse than during the communism era (which is why we still have ~20% support for them in parliament). I'd say neither of either (communism/socialism) vs. capitalism is better - but I'd take capitalism any day over it (because doing work well pays off in capitalism, while it doesn't in the other one).




My apologize for long post, I wanted to share my opinion on both - capitalism, communism and my own experience. I'm sure people from west or US have different opinion, but you've never lived through it, so you don't really have means to compare.  :wink:

In Topic: problem with ray/box intersection in GLSL

30 September 2016 - 12:49 PM

Shameless self-promotion: http://www.gamedev.net/page/resources/_/technical/math-and-physics/intersection-math-algorithms-learn-to-derive-r3033 - this is probably more optimal algorithm for the GPU (I've been using (similar version to this) in OpenCL/CUDA for quite a bit of time, I'm sure GLSL is able to handle it too).


Don't try to build your code to avoid divisions by 0, especially in world of real time ray tracing, build it in such way so you can handle division by zeroes (use the properties of IEEE floating point math - like INF value or NAN value).


Let me try to dig something on my AABB intersection here on local machine.




To add here - this is my gpu-based Ray-AABB test done when working with KD-tree (and testing against AABB sorrounding whole tree):

float4 v1 = (aabbMin - o) * invRay;
float4 v2 = (aabbMax - o) * invRay;
float4 n = min(v1, v2);
float4 f = max(v1, v2);
float enter = max(n.x, max(n.y, n.z));
float exit = min(f.x, min(f.y, f.z));

if (exit > 0.0f && enter < exit)
    // We have a hit


  • aabbMin - is float4 which contains min point in X, Y and Z members and 1.0 in W member
  • aabbMax - is float4 which contains max point in X, Y and Z members and 1.0 in W member 
  • o - is ray origin point with 1.0 in W member
  • invRay - is float4(1.0 / rayDirection.x, 1.0 / rayDirection.y, 1.0 / rayDirection.z, 0.0)

Functions min (and respectively max) are working per component, like:

float4 min(float4 a, float4 b)
    return (float4)(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), 0.0);

In Topic: Is OpenCL slowly dying?

28 September 2016 - 05:36 PM



I see, as it pretty much covers the GPU architecture - which isn't really evolving that fast (I know there were quite good hardware changes like going down to 14nm in the last generation, but from the functionality point of view, there aren't any major steps). So pretty much they are just improving the actual language and support.


I will definitely google some info about OpenCL and C++ support in it (which kind of interests me), I didn't even realized they moved that far.

In Topic: Is OpenCL slowly dying?

28 September 2016 - 12:04 PM

Thanks for the input.


What made me originally believe that the support for OpenCL is waning is the fact that there the updates for it are not that frequent (although on the other hand, with exceptions for new extensions, OpenGL 4.5 is like 2 years old standard too ... Vulkan updates are a different thing, but that is a fresh api).


Maybe it was just my feeling, as I haven't seen pretty much anyone working with it in last year or so (although I'm still keeping OpenCL code in my code base and using those kernels). Although as my requirements are not aiming for perfect precision, I might be better of going the compute shader way (with GLSL).