Jump to content

  • Log In with Google      Sign In   
  • Create Account

Yann L

Member Since 06 Feb 2002
Offline Last Active Mar 30 2012 02:53 PM

#4897357 SOPA

Posted by Yann L on 25 December 2011 - 05:48 PM

As ChurchSkiz said. Governments are notoriously incompetent and technophobic when it comes to technologies they don't understand and that they perceive as a potential threat to their power monopoly. And they're notoriously competent at retaining this said power and associated revenue streams with all means, even if that means undermining the very principles of democracy they are supposedly built upon. Nothing new here.

I haven't followed this SOPA deal, but from a quick look it seems indeed messed up. Then again, copyright law by itself (and patent law even more so) is messed up and is in dire need of a major overhaul to modern standards, especially with respect to the ever more prevalent global networking environments people live in today. Copyright is obviously an important concept, but criminalizing major parts of the population for minor infringements is just ridiculous and archaic.

#4886949 Productive Hours

Posted by Yann L on 23 November 2011 - 11:51 AM

I'm definitely most productive at night.

For me the reason is the total lack of external disturbances at night. At daytime, you are constantly interrupted by phone calls, emails, people coming into your office with stupid questions and whatnot. And even if you put that "don't disturb me or I'll rip your head off" sign on your office door, the simple fact of knowing that something could potentially interrupt you at any time puts your brain in an annoying state of alertness that disrupts this special kind of 'flow' you need for programming.

All that are non-issues at night. Your subconscious knows that no external event will interfere with your activity for hours on end. And that tremendously improves productivity for me.

#4882844 Please advice - GPU Gems relevance for GLSL?

Posted by Yann L on 10 November 2011 - 09:33 PM

Books like GPU Gems, GPU Pro or the ShaderX series are about techniques, algorithms and math. A 3D API is just a tool to implement these algorithms and is completely interchangeable. In practice both HLSL and GLSL is used by articles in these books for their example implementations. Many are completely API agnostic and entirely math centric (with maybe some shader pseudo-code).

Just a note of warning though. Especially the later books in the series contain some very advanced research material that assumes a very firm understanding of your target shader API. These books will absolutely not teach you how to write shaders.

#4877926 The Stallman requirements

Posted by Yann L on 28 October 2011 - 11:58 AM

I think this is good information and it is very considerate of him to provide it for free (as in freedom !). This helps tremendously at organizing an event while making sure that Stallmann will not accidentally show up and ruin it. Following these guidelines will also make sure that Stallmann will not knock on your door while looking for a place to sleep, resulting in your A/C suddenly running a free firmware locking it to 22 degrees centigrade and your cat being traumatized for life.

(As an aside - Ubuntu is non-free? Anyone know what he's referring to here?)

Ubuntu includes many components that does not follow RMS own personal religious definition of "freedom" (binary drivers or firmware, non-GPL software, use of trademarked logos like the Firefox one, etc).

#4871382 Is it still easy to crack .NET and java code nowadays?

Posted by Yann L on 11 October 2011 - 03:25 AM

To be honest, I feel a bit alienated by this fatalist attitude towards the value of ones own code that seems to be rampant on this board lately. People claiming that you could just as well post your code on facebook because it's so worthless even the most basic protection would be wasted, that the general value of code is zero (pointing to github or whatever), and so on.

I totally disagree with these claims. Did you look at the general code quality for projects on sites like github, sourceforge and co ? 99% of the code available there would not even pass basic code review in any serious software company. High quality, clean, well tested and documented code can gain value very quickly. And we're not even talking about trade secrets or any super innovative new algorithm here. It's simply about good craftsmanship. And that costs money. Of course this can get exponentially higher if actual trade secrets come into play.

Mind you, we are not talking about cracking here. We are talking about illegal code reuse. Someone taking large chunks of your code and copying them almost verbatim into his own products. Someone stealing your valuable time in order to improve his products without major effort.

Yes, you can take legal action against that. However, as Antheus mentioned, few people have the financial resources to pay for the lawyers and the legal procedures, which can take years. Furthermore, a lot of these violations occur in countries where legal action is not an option (eg. China). And finally, it can be extremely hard to prove that the offending party actually took your code. In contrast to some people here, these intellectual property violators might not think their (stolen) code to be worthless and will certainly not keep it open for you to inspect that easily.

So in conclusion, yes I think that easy decompilation is a major concern with managed languages. There is no perfect solution to this problem as of yet (at least not as good as native compilation, which makes code reuse almost impossible). The minimum for any serious project should be obfuscation.

#4867823 Caused extreme distress

Posted by Yann L on 30 September 2011 - 07:39 PM

I don't know what this thread is about, but it's obviously not about game programming. Closed.

#4864830 Combining Reflective Maps with Materials

Posted by Yann L on 22 September 2011 - 02:10 PM

Ashaman73's equation is the typical Phong model plus added Fresnel. This is a common approach, but unfortunately it's physically highly incorrect. Specular and diffuse reflections aren't additive in reality.

Vincent, you are on the right track with your ideas. The key point is energy conservation. The optical model of how light reacts when hitting a surface is usually described by a bidirectional reflectance distribution function (BRDF). Depending on the material such a functions can be very, very complex (think of layered, partially translucent materials such as the human skin, for example), but they can also be quite simple. In fact, the Phong model is a very simple BRDF.

Just think about how simplified optics would work on a smooth surface, while keeping energy conservation. Photons come in, and some of them are directly bounced back when hitting the outer layers of the material. That's your specular reflection. Depending on the material type (metal, dielectric, etc), these reflections can be wavelength dependent or not. And depending on the roughness of the surface, they can be more or less blurred.

The remaining energy penetrates further into the material and will be gradually diffused, ie. partially absorbed and partially bounced back in random directions. That's your diffuse color term. If the material is transparent or translucent, some energy will neither be specularly nor diffusely reflected, but transmitted through the material, potentially being refracted and/or some wavelength absorbed (filter materials).

I like this PDF here. It's a description of how the Mental Ray architectural shaders work. Although for offline use, the same principles are universally applicable. It comes with nice rendering examples of how the individual components influence the appearance of a material. Chapters 1.3 and 1.4 are most important. A simple energy conserving shader can go a long way towards realistic materials, even without simulating the more difficult effects like refractions or translucency.

#4863882 The dumbest products you've seen advertised

Posted by Yann L on 20 September 2011 - 10:58 AM

There is no such thing as herbal or alternative medicine. There is only that which has been tested and found to work (we call this medicine) and that which has not (homeopathy, crystals, vitamins to cure aids, reflexology, acupuncture and so on).

Herbal medicine = informal way of saying that you eat the freaking plant/fungus/whatever directly instead of taking the extracted or synthesized compound as a pill.

#4863623 Rendering to Cubemap for Environment Mapping

Posted by Yann L on 19 September 2011 - 07:13 PM

You are mixing up different concepts here (cube map faces, MRTs, render buffers, etc).

It looks like you are indeed rendering the scene 6 times. That would be the first approach I outlined earlier. For this to work, you will need to bind the cube sides one after the other, while rendering the matching camera view:

// Bind the FBO
glBindFramebuffer(GL_FRAMEBUFFER, fboHandle);

// Attach a depth renderbuffer to the FBO
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderbufferHandle);

// Render the six views
for( int i = 0; i < 6; ++i ) {

   // Bind the i'th face of the cube texture as target to color attachment 0
   glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, cubeTextureHandle, 0);

   // All following render calls will now end up on the i'th side of the cubemap !

   // Setup camera and render scene for the i'th view into the previously bound cubemap face


// Unbind FBO
glBindFramebuffer(GL_FRAMEBUFFER, 0);

// Cubemap at cubeTextureHandle is now complete.

This assumes that your are only interested in a color cubemap texture and it uses a shared depth buffer for the rendering. If you want a depth cubemap generated in the same 6 passes along with the color cubemap, then drop the render buffer and add a second glFramebufferTexture2D call to the loop, attaching the i'th depth cube texture face to GL_DEPTH_ATTACHMENT. Something like:
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, depthCubeTextureHandle, 0);

#4863580 The dumbest products you've seen advertised

Posted by Yann L on 19 September 2011 - 05:30 PM

Many "homeopathic medicines" are legitimate herbal combinations with very good results. Others, less so.

Frob, what you are talking is herbal medicine. And I agree, it can indeed be very effective. A lot of modern pharmaceutical research is about extracting and synthesizing the active substances of naturally occurring organisms (often toxins, ironically).

But this is not homeopathy. There is no active substance in homeopathy. The very principle of this concept is that you don't even ingest a single molecule of the remedy, but only water. The supposedly occurring effects are explained by new-age ideas (energy fields that were left by the active molecules before dilution and such nonsense) that completely lack any scientific basis. It has been proven again and again that under controlled conditions, homeopathy has the same effects as a pure placebo. Which seems logical, since it's just plain water (or ethanol or whatever is used for dilution).

So yeah, homeopathic 'remedies' classify indeed as useless and dangerous. They should be made illegal.

#4861759 Rendering to Cubemap for Environment Mapping

Posted by Yann L on 14 September 2011 - 04:12 PM

Just so that we understand each other: you want to render to a cubemap, right ? I got a bit confused when you started talking about texture samplers.

The first code snippet I posted uses a six pass technique. You render your scene six times, once for each of your 6 cameras. glFramebufferTexture2D is called to attach a specific cubemap side as the target for each of the rendering passes. A cubemap side attached this way will behave like a normal 2D texture target. You gradually build up your cubemap by cycling through all the GL_TEXTURE_CUBE_MAP_* constants as targets.

The second method is a single pass approach. You bind the entire cubemap as a target, and only perform a single render pass. This method requires a geometry shader that will duplicate each primitive six times, projecting it onto all six cubemap faces simultaneously (through your six view-projection matrices). The geometry shader directs each duplicated primitive to the appropriate cube target face using the gl_Layer variable.

#4857159 Texture Colors Not exact as Texture

Posted by Yann L on 03 September 2011 - 08:56 AM

Not even mentioning that the code above invokes undefined behaviour and could possibly lead to memory leaks or even severe heap corruption.

BYTE *bits = new BYTE[FreeImage_GetWidth(dib) * FreeImage_GetHeight(dib) * 3];


delete bits;

#4856583 Texture Colors Not exact as Texture

Posted by Yann L on 01 September 2011 - 09:47 PM

The red and blue channels are probably swapped, ie. your image data comes in BGR component order.

Try GL_BGR as the format parameter to the glTexImage2D call (instead of GL_RGB).

#4854566 So what do you think of this DRM scheme?

Posted by Yann L on 27 August 2011 - 04:18 PM

You know what would happen?

First of all, people would come to your forums/reviews complaining about game being broken, releasing an unfinished product etc. You will blame them for piracy, but some of them will be legitimate customers who were unfairly marked as pirates.

The minority is always the most vocal. It's generally also the most irrelevant. As I mentioned, it is important to make sure your detection system is very tolerant and robust. As long as this is the case, I don't see any problem with exposing pirates and making their lives harder. Yes, there may be false positives, but these can be kept to an absolutely minimum. It's a tradeoff.

Also, you kill any chance of these people ever coming back to play/buy any of your games because they don't want to mess with a broken product.

People say this all the time, and it's generally nonsense. Boycott this, boycott that, and two weeks later everybody has forgotten about it. Although I don't have any numbers to back that up, my gut feeling is that 99% of all these complaining "customers" are in fact pirates that were bit by the protection.

Let's take an extreme example. Assassins Creed 2 had one of the worst, most intrusive and most controversial DRM systems to date, with bugs and flaws that massively affected legitimate players. And you know how that influenced sales ? Well, look:

Ubisoft 2010 Fiscal Results

Ubisoft has released its sales and earnings figures for the fiscal year that ended March 31, 2010.


Fourth-quarter sales were slightly higher than the guidance of around €200 million issued when Ubisoft released its sales figures for the third quarter of fiscal year 2009-10. This performance reflects the combined impact of:

* The accounting restatement of around €8 million in marketing cooperation expenses. These costs were previously deducted directly from the top-line sales figure but are now included in SG&A expenses.

* A strong increase in sales of Just Dance, which, in the total fiscal year, sold-in almost three million units. This performance was particularly impressive as the game was only available on one single platform – the Wii.

* The ongoing exceptional performance delivered by Assassin’s Creed II, which sold-in nearly nine million units during the fiscal year.

* The launch of Red Steel 2 for the Wii, which received very good reviews and whose performance was in line with recently revised forecasts.

* Sales of Avatar that outstripped the most recent forecasts, notably on Wii.

During the first four months of calendar year 2010, Ubisoft’s gained market shares corresponding to 9.9 percent in Europe (versus 8.5 percent one year earlier) and 6.8 percent in the United States (against 5.3 percent).

Emphasis added.

And how much impact do you think will the massive discussions about AC2's DRM have on the sales of AC3 ? Zero.

So what do we learn from this ? Even the worst DRM will not majorly impact sales if the product and marketing is good. It will however severely impact piracy over the first weeks with the highest financial importance.

The OP and myself proposed systems that are far, far less intrusive than the one from AC2 and will, if done right, not impact honest customers at all. The only ones that are going to complain are the pirates. And well, that's kind of the point, you know...

#4854484 So what do you think of this DRM scheme?

Posted by Yann L on 27 August 2011 - 11:15 AM

I think it's a good idea. But you must make sure that legitimate customers aren't affects by this. Put in failsafes and give users the benefit of the doubt (ie. apply very generous tolerance margins to your detection). Some people do really stupid things without realizing it, these may trigger anti-piracy detection even though they purchased a legal copy.

Once you are sure that you are dealing with a pirated copy beyond reasonable doubt (eg. because it is running on a known pirated product key), then have fun. You outlined a rather nice and friendly approach. I personally would go farther than just a 'friendly' nag screen. If someone stole your car, you wouldn't let him get away with it on a friendly reminder to not do it again either. Just make sure to not do anything illegal or to touch any system resources outside of your own game.

I would change the game mechanics in not so subtle ways. Blatantly put the player into impossible situations. Retroactively modify their savegames. Make the game downright unfair. When they inevitably die/lose from the artificially induced unfairness, show them a screen telling them that the game will treat them just the way they treated the developer by pirating it.