| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I would like to test other interpolation options, for this, for a given coordinate XYZ, I need not the interpolated value of XYZ but instead the values of all (or some) grid points surrounding coordinate XYZ.
Does somebody have a smart idea how to do that?
Fragment shader.
I was looking for a bit more details - haven't done much texturing until now...
What I was thinking: since the grid point spacing is constant in a 3d texture, I can easily calculate those inside a shader. So for a coordinate X, I can calculate where (more or less) I have the next grid point below it and above it. I can of course do that for Y and Z too.
Together these would give me approximate coordinates of the 8 grid points surrounding coordinate XYZ. Having those I could then use nearest neighbor interpolation to actually get the precise values stored inside the 8 surrounding grid points.
That would off course require some math and 8 nearest neighbor accesses on the 3d texture.
Does someone have a better/faster/simpler idea?
This is what GL_LINEAR sampling gives you when you have a 3D texture, so I don't think you will see any improvements there over what is built in. But I could see that it might be fun to do some different sorts of samplers with different methods of determine texture coordinates, ratios of the mixes between the samples, and transforms on the samples - that is how a lot of the Core Image filters work.
| References: | |
| >3d texture lookup interpolation options (From: Mark <email@hidden>) | |
| >Re: 3d texture lookup interpolation options (From: "Keith Bauer" <email@hidden>) | |
| >Re: 3d texture lookup interpolation options (From: Mark <email@hidden>) | |
| >Re: 3d texture lookup interpolation options (From: Kent Miller <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.