Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Kaptein

Member Since 03 Feb 2008
Offline Last Active Today, 02:34 PM
-----

Topics I've Started

Full-disk encryption

08 February 2013 - 06:18 PM

Good people,
I don't have any experience with encryption of drives, even after 15 years of programming! Shame on me, but I've had no need of it.
Does anyone here have any experience with it, and if so, which software do you prefer?
Are there any hardware considerations, and lastly, is it enough to encrypt a small portion?
I'm going to be encrypting my code, so it's not very big. (a few hundred MB of data)

See: http://arstechnica.com/tech-policy/2013/02/government-watchdog-warrantless-laptop-searches-at-border-are-a-ok

Which made me think of what I have that is valuable - my code. I'm not necessarily worried about governments, of course. It's a matter of principle. I'm the guy that reads the manuals, and the warnings! Readme writers love me!

Thank you

EDIT: Currently having a look at TrueCrypt ( http://www.truecrypt.org/ )

Rendering to texture(s)

06 November 2012 - 02:22 PM

On the subject of rendering to textures...
I have read each specification up and down 7 times over. That is, I've tried to use FBOs 7 separate times, and found no way to use them in the specific case I'm about to elaborate on
Each time I try, depth-buffer testing no longer works, so, my question is:
If I need to render the scene with depth-testing, I'm guessing I can't use FBOs anymore, which makes them completely useless for me in this particular case.
Is this the case?

Please note that I am currently using FBOs successfully for other things in my project, and I have literally tried every combination of possibility..
I'm only asking as a last resort, just in case anyone has been sitting there for months working out the same problem, and found a solution, or more likely, come to the same conclusion... The specification says that the "real framebuffer" (aka framebuffer 0) is the only one that supports depth-testing

It doesn't matter if I add a renderbuffer or not, as long as I have a depth-texture target the screen is black
If I don't have depth-texture target it draws fine, just without depth-testing anymore
(I can't remember the exact details)

But this is what i need to do:
Render 1x depth, 2x color, remove 1x color, add 1x color, render 1x depth, 2x color, remove 1x color, render 1x depth, 1x color, done
this is the chain, and as you can see, im rendering to on average 3 textures, where one of them is the color target for the fullscreen shader (aka screenspace postprocess texture)
and the depth texture is for the same fullscreen shader


I'm guessing this doesn't work

I'm running OpenGL in compatibility mode (but using mostly 3.x features), so I'm unaware of any differences between core FBOs and compatibility FBOs
I'm hoping they are one and the same (since I don't query entry points for any *EXT)

Help with smooth voronoi diagrams

02 November 2012 - 09:27 PM

[source lang="vb"]sub vor_gradient cdecl(px as f32_t, pz as f32_t, weights as integer, vret as vor_return ptr) dim as integer x = int(px), z = int(pz) dim as vvalue pmin(WEIGHTS-1) dim as vpoint ptr p2 dim as f32_t dist, mindist(WEIGHTS-1) for i as integer = 0 to WEIGHTS-1 mindist(i) = 10 '' set to out of bounds distance next for dx as Integer = x-2 to x+2 for dz as integer = z-2 to z+2 p2 = @vor_points( dx and (VORONOI_TABLESIZE-1), dz and (VORONOI_TABLESIZE-1) ) dist = VOR_EUCLIDIAN( px, pz, dx + 0.5, dz + 0.5 ) for i as integer = 0 to WEIGHTS-1 if dist <= mindist(i) then for j as integer = WEIGHTS-1 to i+1 step -1 '' set N-closest pmin(j) = pmin(j-1) mindist(j) = mindist(j-1) next '' set closest pmin(i).value = p2->value mindist(i) = dist exit for endif next next next '' find max distance #define length  mindist(WEIGHTS-1) #define weight(i) mindist(i) '' inverse distance and recount weights dist = 0.0 for i as integer = 0 to WEIGHTS-1 weight(i) = 1.0 - mindist(i) / length dist += weight(i) next dim as uinteger cl = 0 '' finalize weights and create final color using N-vector for i as integer = 0 to WEIGHTS-1 weight(i) /= dist cl = adduint32(cl, pmin(i).value, weight(i)) next '' return final composite vret->v = cl end sub[/source]
I am trying to blend the nearby weights of voronoi cells
in this example all cell centers are at 0.5, 0.5 for simplicity's sake, and to show the error more clearly
I have tried for a day now to figure out what mistake I'm making, but i just dont understand what I'm doing wrong here

First: I find the N closest points (determined by WEIGHTS)
then I use the longest distance as the "normalizing value" all the way to the end
finally i divide by the total length of the inverted distances (so that the closest point has the strongest weight)
by listening to my brain, this should be working, but it doesn't seem like it's working alright.. :S
Please help!
Note: if you want me to recreate the function in C, that can be arranged since it's not an issue for me..

Here are some example images for 3,4 and 9 weights, first with center at (0.5, 0.5) then with centers at the respective cells for a total of 6 images:

http://art.fwsnet.net/vor/w3c.png
http://art.fwsnet.net/vor/w4c.png
http://art.fwsnet.net/vor/w9c.png

http://art.fwsnet.net/vor/w3.png
http://art.fwsnet.net/vor/w4.png
http://art.fwsnet.net/vor/w9.png

Sums of uniform randoms

01 November 2012 - 09:04 PM

This is my last resort after 2 days of devouring information from everywhere Posted Image
My math skills are relatively poor though, but I have a feeling what I'm trying to do simply can't be done.

I am summing random variables that have uniform distribution, once they are summed they are of normal distribution
With only n = 3, the distribution is already extremely poor.
How can I, and is it even possible to make the distribution uniform again?

This is the ultimate example:

[source lang="cpp"]for (1 ... N) {   X += uniform();}X = uniformize(X, N);[/source]

http://www.johndcook.com/blog/2009/02/12/sums-of-uniform-random-values/
the density function for my final distribution should be a constant 1/N
Posted Image

PARTNERS