"A ship in the harbor is safe, but that is not what ships are built for."
More pages: 1 ... 11 ... 21 ... 31 ... 41 ... 51 ... 61 ... 71 ... 81 ... 91 ... 101 ... 111 112 113 114 115 116 117 118 119 120 121 122 ... 131 ... 141 ... 151 ... 161 ... 171 ... 181 ... 191 ... 201 ... 211 ... 221 ... 231 ... 241 ... 251 ... 261 ... 271 ... 281 ... 291 ... 301 ... 311 ... 321 ... 331 ... 341 ... 351 ... 361 ... 365
Query FailedHumus
Tuesday, April 28, 2009

Grattis Nadja! F�r se om jag �r uppe i Norrland d�. Har inte planerat semestern �n, men det b�rjar bli dags.

Jackis,
I'm sure other people have done the same before. If you're familiar with the math it's not hard to derive, but for less experienced coders it's not straightforward. I've been using this for a while myself, I've had a text file on this site (http://www.humus.name/temp/Linearize%20depth.txt) with basically the same stuff for some time, just wanted to get it into a blog post for easy reference in the future.

Yeah, it's a special case for normal projection matrices. For orthographic projections you can do the same in just one scalar instruction.

Jackis
Tuesday, April 28, 2009

I've thought, it's rather common approach )) That came to us, when some years ago, sitting and thinking about Z-soft particles, I decided to write down after-projection Z and W.

But we have different name to your "ZParams" uniform - "NearFarSettings"

BTW, code like this may be used to calculate scalar difference in camera units between 2 hyperbolic depth-map texels (also with 1 div only).

But this one approach works only for perspective, not for orthographic projections, so if one's visual is working in both of them - special care should be taken.

PS: Lycka till, Nadja!

Nadja
Tuesday, April 28, 2009

t�nkte bara s�ga att jag tar examen 12 juni

wien
Tuesday, April 28, 2009

I actually have been sneaking a peek at your code, but still couldn't get it to work.

The problem is that I, for some reason unclear to me at this point, work in a right handed coordinate system. That of course means that I have to reverse all matrix multiplications etc. in most code samples I find, which makes my puny brain hurt, which in turn makes code not work.

Anyway, I got it to work now. Thanks for the tip.

Humus
Tuesday, April 28, 2009

If you want to look at some sample code you can check any of my deferred shading demos.

wien
Tuesday, April 28, 2009

Spooky. Just a couple of days ago I was tearing my considerable amount of hair out because I couldn't get this conversion to work properly. I eventually gave up and stored the world position directly in a texture (at huge bandwidth expense). Guess it's time to give it another whirl.

ZaPP
Monday, April 27, 2009

Wow, I really enjoyed reading this. I totally agree with you, I often discuss topics like this with friends, since I pirate some stuff, and they do. Take for example a program like 3D studio Max. How are people supposed to learn the program if they can just use it for 30 days and then have to buy it for ~3500$? I mean, come on, they should give out studying licenses for like $50, which you just shouldn't use for any commercial work. Everyone who's really using it will buy it eventually anyway.
Furthermore, i think for example artists should put different licenses/copyrights on their music. They could give out their mp3's that are older than 1-2 years for free, since they don't sell a lot of those cd's anymore. People will listen to it and think it's great music, so they will be more likely to buy a new album when it's there.

James
Saturday, April 25, 2009

You say rape isn't theft, but a rapist steals a number of things from the victim (time, innocence, health, emotional/physical fatigue) are a few. I get your point but bad example.

More pages: 1 ... 11 ... 21 ... 31 ... 41 ... 51 ... 61 ... 71 ... 81 ... 91 ... 101 ... 111 112 113 114 115 116 117 118 119 120 121 122 ... 131 ... 141 ... 151 ... 161 ... 171 ... 181 ... 191 ... 201 ... 211 ... 221 ... 231 ... 241 ... 251 ... 261 ... 271 ... 281 ... 291 ... 301 ... 311 ... 321 ... 331 ... 341 ... 351 ... 361 ... 365