Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Aug 2009
Offline Last Active Oct 02 2013 05:18 AM

#5066438 Distance squared light falloff

Posted by japro on 31 May 2013 - 09:45 AM

...but I've read over and over that it's provable that a point light has 1/d2 falloff, and this formula doesn't work when the radius of the emitter is zero, so I'm still left puzzled about how to reconcile point emitters with spherical emitters.

Yes, an actual 1/d^2 falloff for arbitrarily low d would be unphysical... but so is the concept of a point light source ;). Now if you have a spherical light source you can integrate the 1/d^2 over the sphere surface and will find that it is equivalent to having a point light source at the center of the sphere as long as you are observing from outside the sphere (edit: to clarify i think you have to integrate over the whole sphere surface, so this would be a "transparent" light emitter). Also notice that while moving arbitrarily close to a theoretical point light source the energy doesn't go to infinity, the energy density does...

Generally when we speak of point light sources we mean that the radius of the light source is a lot smaller than the distance we observe from. If for example you had a linear light source then you will find a 1/d falloff and and if you have a light emitting plane there is no falloff at all (assuming the plane/line is infinite, or we are so close to it that we can consider it infinite for practical purposes)


One measures the distance as being 2 feet, and calculates a falloff factor of 1/4.
The other measures the distance as being 0.6096m, and calculates a falloff factor of 2.69.

Here you are mixing up relative and absolute measurements. You quoted "doubling the distance cuts the intensity by four"... now how do you go from doubling the distance to "2 feet"? Or more specifically, which distance did you double?

Doubling the distance would mean to go from 1 foot to 2 or from 0.3m to 0.6m in both cases you doubled the distance and quartered the intensity...

#5065832 RTS Zoom in and Zoom out, how do they do it?

Posted by japro on 29 May 2013 - 09:30 AM

You usually don't actually scale any objects, you just change the "camera transform".

#5064975 Programming in OpenGL 4 with a netbook, it is posible?

Posted by japro on 26 May 2013 - 07:29 AM

Hold on. Let OP say what graphics card he's got.

If it is GMA3150 (like in my netbook), then he should say farewell to shaders. It is hard to say that GMA3150 supports even GL1.5, and it is light-years away from the GL 2.0. There is only 2 fragmet shader units, and vertex shader is supported only in software (for D3D). There is an interface to some prehistoric version of shaders, but there is no support even for GLSL 1.x.

At least under linux I can use GLSL 1.0 on my Atom N550 netbook (which has said GM3150). Performance is obviously questionable at best.

#5064859 Programming in OpenGL 4 with a netbook, it is posible?

Posted by japro on 25 May 2013 - 04:13 PM

OpenGL will run on almost anything, but the feature level will vary. Intel based netbooks report as OpenGL 1.4 I think but support extensions that almost make them OpenGL 2 compatible (most of the missing extensions are multisample related afair). I think some of the AMD based netbooks even had OpenGL4 support but don't quote me on that.

#5063886 How to balance freedom of expression & abuse in games?

Posted by japro on 22 May 2013 - 10:51 AM

I can't remember where I read that but there was some article about building a "safe environment for kids" in a online game by having a sentence construction toolkit that only consisted of "safe words". Apparently within minutes of playtesting with actual children someone had come up with something along the lines of: "I want to stick my ice cream into your fluffy bunny"... so no matter how you do it time-to-penis is always finite and usually really short biggrin.png

#5058586 Microsoft burned down my home, where now?

Posted by japro on 02 May 2013 - 04:45 AM

...I've been learning C# for awhile now, and from a developer standpoint, this is an investment. I don't have time or resources to doubt myself and reverse all the time I've spent on it now in favor of C++...

Luckily programming skill isn't language specific. There is no reason to "reverse all the time" to switch over from C#/XNA to C++/DX/OGL since most of the actual knowledge transfers over (protip: syntax and api aren't the hard part about programming :P).

#5058189 opengl compute shaders

Posted by japro on 30 April 2013 - 04:08 PM

I'm too lazy to actually boot my laptop into windows and install that driver and install dev tools atm. But if anyone wants to try another example here is one: https://github.com/progschj/OpenGL-Examples/blob/master/13compute_shader_nbody.cpp It works fine on my nvidia desktop. It should work when changing it to use the ARB extension instead of the 4.3 context on amd I guess,

#5053871 Opengl 3+ rendering to a texture

Posted by japro on 16 April 2013 - 09:36 AM

It shouldn't matter whether the texture was/is attached to a fbo at any point. Just don't render to a texture you are currently sampling from :)

#5047579 OpenGL core profile question

Posted by japro on 28 March 2013 - 04:15 AM

For core profiles glew is kinda hit miss afaik. It doesn't support them cleanly. So it is usullay preferable to use a loader like gl3w or glxw.

#4992079 Creating instance of the class, as a pointer or not?

Posted by japro on 20 October 2012 - 02:33 AM

In the pointer case you should initialize the pointer from your main (or a function called from there) and also delete it at the end of the program/deinitialization. The main advantage of the pointer solution is imho that you can control the lifetime of the object and obviously you can also use polymorphism (say if you have RendererOpenGL and RendererD3D or so). Both approaches are valid depending on what you want exactly.
Also if you are not using a pointer you don't actually need the "= Renderer()". Just "Renderer renderer();" is ok.

#4990759 Voxel based world, best practice for sending information

Posted by japro on 16 October 2012 - 09:29 AM

To avoid unnecessary updates one could also cache chunk data on the client side and essentially version the chunks. So before resending a whole new chunk (after the player walked away and back) you can first check if the "version" on the server has changed. Most of the other things like only sending deltas etc has already been said.

#4990756 quadratic bezier curve - circle intersection

Posted by japro on 16 October 2012 - 09:21 AM

Well, numerical methods such as newtons method will also give reasonable solutions for most practical purposes.

#4989069 OpenGL VBO

Posted by japro on 11 October 2012 - 05:54 AM

Google for "glew" and/or "gl3w".

#4989063 OpenGL VBO

Posted by japro on 11 October 2012 - 05:44 AM

You simply use the data array directly. Also you don't really use VBOs in that java code ;). You just use draw arrays to draw array data.
example (lines 169 and following): https://github.com/progschj/OpenGL-Examples/blob/master/01shader_vbo1.cpp

#4988642 Should you support Linux?

Posted by japro on 10 October 2012 - 02:27 AM

I doubt that there is a lot of "Linux gamers" in the sense that they strictly use Linux... But there might be a significantly higher amount of "Gamers that mostly use Linux for non-gaming" which then just boot into Windows to play. So on the one hand you could argue they will buy the game anyway for windows, on the other hand having a linux version could make the game more attractive to them. Especially if its a more casual game you probably don't want to reboot the machine just to play a round of angry birds...