Recommended Posts

Hello!

I've read MJP's great post on CSM and jiggling/shimmering and it seem to be the exact problem i'm having (I realise it's from 7 years ago or so but it seems very relevant)

I was hoping someone you had time to help me solve it or point me in the right direction. I feel like i've learned the concepts and read everything I can find on the subject but I just can't seem to solve it. I'm more than happy to pay someone for their time, I just want this solved so I can forget about it because my game is at a fun stage were I can really start adding all the good bits (combat and spell effects, dungeons, swords etc).

Anyway..

Here is a

" rel="external">youtube video of the problem. I turn on the render target view about halfway through so you can see the shadow map top right. I've turned off all but the closest cascade for now and stretched it rather far so the quality isn't amazing but it shows the jiggling problem nicely.

My method for making the projection is pretty short and is very similar to MJPs post:

        public void GenerateCSMOrthoSliceTS(float pNearClip, float pfarClip)
{
Vector3[] frustumCorners = new Vector3[8];

Matrix mCameraViewProj = _Camera.CameraView;
mCameraViewProj *= Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, _Camera._aspectRatio, pNearClip, pfarClip);
BoundingFrustum oCameraViewProjFrustum = new BoundingFrustum(mCameraViewProj);

frustumCorners = oCameraViewProjFrustum.GetCorners();

Vector3 frustumCenter = new Vector3(0, 0, 0);
for (int i = 0; i < 8; i++)
frustumCenter += frustumCorners;
frustumCenter /= 8;

radius = (frustumCorners[0] - frustumCorners[6]).Length() / 2.0f;

Vector3 eye = frustumCenter + (SunlightDirection * radius);

if (_nojiggle)
{

Matrix roundMatrix = Matrix.CreateTranslation(rounding.X, rounding.Y, 0.0f);

}
}

Edited by skyemaidstone
not really dx11 specific

Share on other sites

kinda looks like a bias issue. the depthmap is of limited precision, so shadow acne (shimmering), or peter-panning (shadows that are biased too much, and become dis-attached from the occluder)  are usually related to biasing.

What value do you have in your second pass pixel shader that serves as the bias? Maybe try toggling that a bit, and see what it gives you, it can be very scene dependent.

Share on other sites

Yes I thought that too at first so i played around with a depthbias (not going as far a slope based) but it still visibly moves/jiggles when I move or rotate the camera. Adding a bias does stop the wall (for example) flicking in and out of shadow but not the edges of the wall from shimmering.

I've removed that (and my filtering too) for now to try and narrow down the problem.

Share on other sites

Ok I also tried simply adding a flag to stop recalculating the shadow light view and projection when I set it to true - I was thinking if it's a texel snapping issue then that would stop the jiggling/shimmering (although obviously only the area of the projection when it was last created would be shadowed). I can see my flag working because the shadow render target now remains fixed when the flag is on.

But the jiggling remains even with that. Maybe I'm doing texel snapping and using a bounding radius correctly but the problem lies elsewhere. Do I need to some kind of rounding on the camera position for the calculation of shadows or something? I'm a bit stumped again. Or maybe my texel snapping just isn't following what MJP's post suggested somehow.

Anyone have anything else I can try or any other ideas?

Share on other sites

I looked through your code, and so far it seems okay. So I'm not sure where the issue is.

Do you ever use ShadowLightProjection again anywhere outside of the code that you posted? Because you've applied the rounding offset to ShadowLightViewProjectionMatrix, but not to the matrix containing only the projection.

Share on other sites

You're spot on. For some reason I was redoing ShadowLightViewProjection = ShadowLightView *ShadowLightProjection just before I passed it to the shader. Which explains why it made no difference entirely.

I thought it was finally solved... but no, although when I turn the snapping on my shadow mapping changes a little (so it's doing something). But it still jiggles around a lot.

" rel="external">Curse of the Jiggles (The green true false top left is texel snapping enabled or not).

I feel like I must be doing something else stupid elsewhere then.

When render the models to my map/rendertarget I can just use the normal way i'd render a model can i? ie Make a local matrix for them using their scale, rotation and world position then use that * the shadowLVP.

And when I look up the position in my pixel shadow i just use (this is the basic version with no filtering to keep things simple until I solve this):

float4 lightScreenPos = mul(worldPos, ShadowLightViewProjection);

//find sample position in shadow map
float2 lightSamplePos;
lightSamplePos.x = lightScreenPos.x/2.0f+0.5f;
lightSamplePos.y = (-lightScreenPos.y/2.0f+0.5f);

float realDistanceToLight = lightScreenPos.z;

shadowCondition = distanceStoredInDepthMap <= (realDistanceToLight - 0.00035f);


Does that all make sense or do I need to apply rounding somewhere else too?

Edited by skyemaidstone
typo

Share on other sites

Yeah, you don't need to account for the rounding and snapping when sampling the shadow map in your shader . The shader code that you've posted there looks fine to me, as long as you're always using an orthographic projection for your shadow map projection.

Perhaps you should try visualizing the resulting shadow map in real-time. As you move the camera, the geometry should always "snap" a full pixel at a time. If you see any crawling edges that indicate sub-pixel movement, then somehow things aren't snapping correctly when you render to the shadow map.

Share on other sites

Thanks,

I found an old test harness for trying out shadows and lights on my models in an old version of my engines. The shadows are rock solid for point lights or directional . So I've introduced this jiggling somehow, somewhere along the line

At least I know where to look now.

Share on other sites

Well texel snapping is working great. Rock solid shadows at last (this is just one cascade)

" rel="external">No more jiggling

After much fiddling and comparing my test harness the only difference seemed to be the huge numbers my game was using for the coordinates in game. If i reduced everything by say 100 it all looks the same but the shadows no longer jiggle at all.

I don't quite get why that is. Depth map precision? Is it because my huge numbers (the centre of my map was 50000,0,50000 and the bounds were at 1024000. My near/far clip were at 5, 200000.

I thought these kind of numbers would be ok in a 24bit depth map or is it because all the precision is near to the camera and you can't use those kind of high numbers?

I happy I fixed it in the end but I don't quite get why. Could someone explain it to me if possible?

Edited by skyemaidstone
typo

Share on other sites

Thanks. So just to confirm before I read that, what I'm describing is a depth map precision problem caused by my huge coordinates?

Share on other sites

You allocate 32 bit/texel, waste 8 bit/texel on some stencil you are not using. Use a 32 float depth texture without a stencil and reverse your depth (swap far and near, use a greater instead of less test) to have a better distribution.

Share on other sites

Thanks again but what i'm asking is if the problem i was experiencing could be caused by using huge coordinates (and therefore causing a lack of depth precision). I have solution, i'm just trying to make sure understand it.

Thanks for the link. I will have a read of that in depth later tonight

Share on other sites
1 hour ago, skyemaidstone said:

the centre of my map was 50000,0,50000 and the bounds were at 1024000. My near/far clip were at 5, 200000

This may be very bad, yes.

Assuming we have 6 digits of floating point precision, the next possible number from 50000 is 50000.1

If you have a ratio of 1 unit == 1 meter, then you have not enough precision to for small details at the scale of centimeters, but you would have had enough if you center your world to the zero point.

Even if you have a ratio of 1 unit = 100 meters, you still waste precision. Assuming your world's bounding box corners the zero point, you waste one bit (because the sign is unused). If the world bounding box is far away from zero however, you do it very wrong: The larger the distance, the bore bits get wasted for nothing.

So you should have your origin close at (0,0,0) in any case. I'm no floating point expert, but it is said the best precision is between -1 and 1, so you should also use a scale that makes sense here, e.g. 1unit = 1meter for FPS or 1unit = 100meter for large open world. (for very large open world like space game you may need even need to translate the whole world so the player is at the center to avoid  precision issues).

... not sure how this affects your graphics issues, but you can try out various scales and center offsets.

Edited by JoeJ

Share on other sites

Thanks Joe. I think that explains my problem (and solution) perfectly.

Share on other sites

Sorry a couple more questions.

How is reversing the depth generally done? Can i literally just set my cameras far/near in reverse (for the projection matrix) when rendering everything (including models to shadow map)? Do i need to do something different with storing the depth in the buffer? I'm just writing out z/w for everything right now (except linear for mist particles)

Create an account

Register a new account

• 10
• 11
• 12
• 10
• 12
• Similar Content

• I've been interviewing a few job candidates recently. I wrote a short list of what I could consider pretty basic C# questions for them. My intention with these questions was to use them as a jumping off point for more interesting discussions, but so far, people have struggled to answer them. So I thought I'd post them here to get some feedback from people.
Basically, am I expecting too much? These are pitched at mid-senior developer level.

All feedback much appreciated.
Technical Interview questions.pdf

• So I am building a turn based rogue-like (think CDDA). The game is going to have a very large map (up to 1000's x 1000's) however to alleviate most of that I obviously can't render everything so there will just be render a certain radius around the player and just load in and out data as the player moves.
The next major system I am prototyping is making interactive tiles destructible and pretty much everything will be destructible besides basic landscape (cars, doors, windows, structures, etc. will be destructible)
While I am only rendering a certain amount of tiles around the player, I want to keep the amount of colliders active at one time to be as small as possible for performance and currently the tilemap tool I use automatically merges colliders together.
So instead of creating a separate colliders for each of these tiles and having the destructible behavior tied to that object (which my tilemap tool would allow me to do) I was thinking that I would store an array of all the X and Y locations for the interactive tilemap layer and let the tilemap manage the colliders.
Then when I hit a collider on the interactive tilemap layer, instead of of getting the behavior for how to deal with the destruction for that tile from that game object, I would pull it from the array I mentioned earlier based on the tile I attempt to interact with which I already have.
Does this sound like a good approach? Any other recommendations would be welcomed.
• By B. /
Hello Everyone,
I write COLLADA Importer and my next goal was to import rigged Characters, so check up the file ,but don't understand one step. I see where the joints and the weigts are, but not where the file say which vertex has which weight. So maybe you guys can help me and explain it?
<vertex_weights> has only the indices of the joints and weights
Here's a part of my COLLADA file:
<library_controllers> <controller id="pCube1Controller"> <skin source="#pCube1-lib"> <bind_shape_matrix>1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 </bind_shape_matrix> <source id="pCube1Controller-Joints"> <Name_array id="pCube1Controller-Joints-array" count="18"> Hip LegL FootL ToeL LegR FootR ToeR Belly ShoulderR ArmR HandR FingerR ShoulderL ArmL HandL FingerL Neck Head</Name_array> <technique_common> <accessor source="#pCube1Controller-Joints-array" count="18"> <param type="name"/> </accessor> </technique_common> </source> <source id="pCube1Controller-Matrices"> <float_array id="pCube1Controller-Matrices-array" count="288"> -0.941340 -0.337461 -0.000000 -0.139955 -0.337461 0.941340 -0.000000 0.371721 0.000000 -0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.248803 -0.968554 -0.000000 -0.585359 -0.968554 0.248803 -0.000000 -0.201095 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 -0.034984 -0.999388 -0.000000 -1.221391 -0.999388 0.034984 -0.000000 -0.474481 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 -0.000000 0.000000 0.541746 0.000000 1.000000 0.000000 1.913253 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.248802 0.968554 0.000000 0.585358 -0.968554 -0.248802 -0.000000 0.201094 -0.000000 -0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 -0.034983 0.999388 0.000000 1.221387 -0.999388 -0.034983 -0.000000 0.474481 -0.000000 -0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 -0.000001 0.000000 -0.541746 -0.000001 -1.000000 -0.000000 -1.913249 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.043672 0.999046 0.000000 -0.000137 -0.999046 0.043672 -0.000000 0.003133 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.995861 0.090881 -0.000000 -0.021829 -0.090881 -0.995861 -0.000000 0.184414 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.987330 0.158679 -0.000000 0.470613 -0.158679 -0.987330 -0.000000 0.217060 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -1.000000 0.000001 -0.000000 1.419031 -0.000001 -1.000000 -0.000000 -0.008213 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.941340 0.337462 -0.000000 1.988030 -0.337462 -0.941340 -0.000000 0.703965 -0.000000 -0.000000 1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.995861 -0.090881 -0.000000 0.028074 -0.090881 0.995861 0.000000 -0.183843 0.000000 0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.987330 -0.158678 -0.000000 -0.464421 -0.158678 0.987330 0.000000 -0.216064 0.000000 0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -1.000000 -0.000000 -0.000000 -1.412754 -0.000000 1.000000 0.000000 0.008213 0.000000 0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 -0.941340 -0.337462 -0.000000 -1.982131 -0.337462 0.941340 0.000000 -0.701850 0.000000 0.000000 -1.000000 -0.000000 0.000000 0.000000 0.000000 1.000000 0.043673 0.999046 0.000000 -0.483504 -0.999046 0.043673 -0.000000 -0.018032 -0.000000 -0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.043673 0.999046 0.000000 -0.963774 -0.999046 0.043673 -0.000000 -0.039026 -0.000000 -0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000</float_array> <technique_common> <accessor source="#pCube1Controller-Matrices-array" count="18" stride="16"> <param type="float4x4"/> </accessor> </technique_common> </source> <source id="pCube1Controller-Weights"> <float_array id="pCube1Controller-Weights-array" count="534"> 1.000000 0.446680 0.448446 0.061039 0.006715 0.037120 0.423137 0.341108 0.035586 0.104220 0.095948 0.430593 0.105918 0.018535 0.346667 0.098287 0.446679 0.037120 0.448446 0.061040 0.006715 0.163148 0.388913 0.396025 0.037444 0.014469 0.396151 0.187946 0.014532 0.076902 0.324469 0.394204 0.076828 0.187766 0.328622 0.012580 0.166741 0.388259 0.393852 0.036607 0.014542 0.108793 0.424549 0.424576 0.021527 0.020555 0.255692 0.255431 0.312440 0.153135 0.023302 0.258375 0.311167 0.149047 0.258097 0.023313 0.102002 0.388360 0.388353 0.019283 0.102002 0.174648 0.125476 0.307658 0.306598 0.085620 0.287311 0.159158 0.174218 0.287850 0.091463 0.288312 0.172606 0.159037 0.288857 0.091188 0.177388 0.305490 0.303861 0.126946 0.086316 0.120822 0.069144 0.387268 0.384055 0.038711 0.422697 0.058575 0.073700 0.426612 0.018416 0.426332 0.069409 0.056317 0.430430 0.017513 0.124944 0.385012 0.380074 0.070711 0.039259 0.120822 0.069144 0.387268 0.384055 0.038711 0.422697 0.058575 0.073700 0.426612 0.018416 0.426332 0.069409 0.056317 0.430430 0.017513 0.124944 0.385012 0.380074 0.070711 0.039259 0.174648 0.125476 0.307658 0.306598 0.085620 0.287311 0.159158 0.174218 0.287850 0.091463 0.288312 0.172606 0.159037 0.288857 0.091188 0.177388 0.305490 0.303861 0.126946 0.086316 0.108793 0.424549 0.424576 0.021527 0.020555 0.255692 0.255431 0.312440 0.153135 0.023302 0.258375 0.311167 0.149047 0.258097 0.023313 0.102002 0.388360 0.388353 0.019283 0.102002 0.163148 0.388913 0.396025 0.037444 0.014469 0.396151 0.187946 0.014532 0.076902 0.324469 0.394204 0.076828 0.187766 0.328622 0.012580 0.166741 0.388259 0.393852 0.036607 0.014542 0.446680 0.448446 0.061039 0.006715 0.037120 0.423137 0.341108 0.035586 0.104220 0.095948 0.430593 0.105918 0.018535 0.346667 0.098287 0.446679 0.037120 0.448446 0.061040 0.006715 0.490897 0.501024 0.005129 0.002609 0.780985 0.201682 0.001639 0.008414 0.007279 0.783532 0.008348 0.200106 0.007322 0.490896 0.002609 0.501024 0.005129 0.490897 0.501024 0.005129 0.002609 0.780985 0.201682 0.001639 0.008414 0.007279 0.783532 0.008348 0.200106 0.007322 0.490896 0.002609 0.501024 0.005129 0.072569 0.448896 0.467547 0.008240 0.002747 0.072569 0.448896 0.467547 0.008240 0.002747 0.005633 0.494163 0.494079 0.005633 0.005633 0.494163 0.494079 0.005633 0.069536 0.447783 0.471519 0.008441 0.002721 0.069536 0.447783 0.471519 0.008441 0.002721 0.005428 0.496654 0.496927 0.005428 0.496654 0.496927 0.027277 0.465805 0.466166 0.034322 0.006429 0.032529 0.465155 0.458960 0.027694 0.015662 0.001002 0.524597 0.473182 0.002078 0.496491 0.498270 0.002770 0.015604 0.487493 0.476849 0.013049 0.007005 0.014109 0.482061 0.482639 0.018164 0.003027 0.086141 0.395004 0.392832 0.076562 0.049460 0.072924 0.408978 0.409117 0.086668 0.022313 0.025344 0.009121 0.470943 0.470334 0.024259 0.034082 0.007470 0.455706 0.456255 0.046487 0.007387 0.001314 0.489449 0.491035 0.010816 0.510801 0.489110 0.021297 0.004277 0.471874 0.472667 0.029885 0.010295 0.003391 0.488816 0.487692 0.009806 0.075808 0.021321 0.403240 0.403478 0.096154 0.078335 0.035448 0.405277 0.405075 0.075866 0.101905 0.429125 0.429095 0.016145 0.023730 0.099890 0.407814 0.407384 0.030245 0.054666 0.023975 0.481476 0.479747 0.004706 0.010096 0.023316 0.485651 0.485533 0.002137 0.003363 0.001426 0.503487 0.494347 0.001458 0.499436 0.498840 0.023912 0.481531 0.479799 0.004692 0.010066 0.023254 0.485691 0.485573 0.002130 0.003352 0.023299 0.039289 0.097061 0.420322 0.420031 0.016873 0.022080 0.108912 0.426068 0.426067 0.003085 0.004216 0.033460 0.479621 0.479618 0.002649 0.005089 0.018149 0.487709 0.486404 0.007248 0.495761 0.495752 0.515491 0.484439 0.003078 0.004206 0.033395 0.479662 0.479659 0.002639 0.005071 0.018089 0.487755 0.486447 0.001437 0.495838 0.497206 0.005199 0.001437 0.495838 0.497206 0.005199 0.002118 0.498222 0.493106 0.006148 0.002118 0.498222 0.493106 0.006148 0.001407 0.494389 0.498501 0.005388 0.001407 0.494389 0.498501 0.005388 0.002075 0.495166 0.495968 0.006390 0.002075 0.495166 0.495968 0.006390 0.001348 0.499290 0.499290 0.001654 0.029342 0.484184 0.484184 0.001867 0.499012 0.499012 0.001874 0.030698 0.483368 0.483368 0.001352 0.499287 0.499287 0.001642 0.028780 0.484473 0.484473 0.001859 0.030111 0.483671 0.483671 0.001863 0.499013 0.499013 0.017793 0.003436 0.003494 0.487638 0.487638 0.016776 0.003258 0.003214 0.488376 0.488376 0.016776 0.003258 0.003214 0.488376 0.488376 0.017793 0.003436 0.003494 0.487638 0.487638 0.080146 0.034481 0.036694 0.424340 0.424340 0.079527 0.036205 0.034127 0.425070 0.425070 0.079527 0.036205 0.034127 0.425070 0.425070 0.080146 0.034481 0.036694 0.424340 0.424340 0.106011 0.033886 0.040327 0.409888 0.409888 0.104594 0.039175 0.033170 0.411531 0.411531 0.104594 0.039175 0.033170 0.411531 0.411531 0.106011 0.033886 0.040327 0.409888 0.409888</float_array> <technique_common> <accessor source="#pCube1Controller-Weights-array" count="534"> <param type="float"/> </accessor> </technique_common> </source> <joints> <input semantic="JOINT" source="#pCube1Controller-Joints"/> <input semantic="INV_BIND_MATRIX" source="#pCube1Controller-Matrices"/> </joints> <vertex_weights count="116"> <input semantic="JOINT" offset="0" source="#pCube1Controller-Joints"/> <input semantic="WEIGHT" offset="1" source="#pCube1Controller-Weights"/> <vcount>5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 5 4 4 4 5 4 4 5 5 4 4 5 5 3 3 5 5 3 4 5 5 5 5 5 5 5 2 5 5 5 5 5 5 5 5 3 3 5 5 5 5 5 5 3 2 5 5 4 4 4 4 4 4 4 4 3 4 3 4 3 4 4 3 5 5 5 5 5 5 5 5 5 5 5 5</vcount> <v>0 1 1 2 2 3 3 4 4 5 0 6 1 7 2 8 4 9 7 10 0 11 1 12 2 13 4 14 7 15 0 16 1 17 4 18 5 19 6 20 7 21 12 22 13 23 14 24 17 25 0 26 1 27 2 28 4 29 7 30 0 31 1 32 4 33 7 34 17 35 7 36 8 37 9 38 10 39 17 40 7 41 12 42 13 43 14 44 17 45 7 46 8 47 12 48 13 49 17 50 7 51 8 52 9 53 12 54 17 55 7 56 8 57 9 58 10 59 12 60 7 61 8 62 12 63 13 64 17 65 7 66 8 67 12 68 16 69 17 70 7 71 8 72 12 73 16 74 17 75 7 76 8 77 9 78 12 79 17 80 7 81 8 82 12 83 13 84 17 85 7 86 8 87 12 88 16 89 17 90 7 91 8 92 12 93 16 94 17 95 7 96 8 97 9 98 12 99 17 100 7 101 8 102 12 103 13 104 17 105 7 106 8 107 12 108 16 109 17 110 7 111 8 112 12 113 16 114 17 115 7 116 8 117 9 118 12 119 17 120 7 121 8 122 12 123 13 124 17 125 7 126 8 127 12 128 16 129 17 130 7 131 8 132 12 133 16 134 17 135 7 136 8 137 9 138 12 139 17 140 7 141 12 142 13 143 14 144 17 145 7 146 8 147 12 148 13 149 17 150 7 151 8 152 9 153 12 154 17 155 7 156 8 157 9 158 10 159 12 160 7 161 12 162 13 163 14 164 17 165 0 166 1 167 2 168 4 169 7 170 0 171 1 172 4 173 7 174 17 175 7 176 8 177 9 178 10 179 17 180 0 181 1 182 2 183 3 184 4 185 0 186 1 187 2 188 4 189 7 190 0 191 1 192 2 193 4 194 7 195 0 196 1 197 4 198 5 199 6 200 0 201 1 202 2 203 4 204 0 205 1 206 2 207 4 208 7 209 0 210 1 211 4 212 7 213 0 214 1 215 4 216 5 217 0 218 1 219 2 220 4 221 0 222 1 223 2 224 4 225 7 226 0 227 1 228 4 229 7 230 0 231 1 232 4 233 5 234 7 235 8 236 9 237 10 238 17 239 7 240 8 241 9 242 10 243 17 244 7 245 8 246 9 247 12 248 7 249 8 250 9 251 12 252 7 253 12 254 13 255 14 256 17 257 7 258 12 259 13 260 14 261 17 262 7 263 12 264 13 265 7 266 12 267 13 268 0 269 1 270 2 271 3 272 4 273 0 274 1 275 2 276 3 277 4 278 0 279 1 280 2 281 0 282 1 283 2 284 3 285 0 286 1 287 2 288 3 289 4 290 0 291 1 292 2 293 3 294 4 295 0 296 1 297 2 298 3 299 4 300 0 301 1 302 2 303 3 304 4 305 0 306 1 307 4 308 5 309 6 310 0 311 1 312 4 313 5 314 6 315 0 316 1 317 4 318 5 319 6 320 4 321 5 322 0 323 1 324 4 325 5 326 6 327 0 328 1 329 4 330 5 331 6 332 0 333 1 334 4 335 5 336 6 337 0 338 1 339 4 340 5 341 6 342 1 343 2 344 3 345 4 346 6 347 1 348 2 349 3 350 4 351 6 352 1 353 2 354 3 355 4 356 6 357 1 358 2 359 3 360 4 361 6 362 1 363 2 364 3 365 1 366 2 367 3 368 1 369 2 370 3 371 4 372 6 373 1 374 2 375 3 376 4 377 6 378 1 379 3 380 4 381 5 382 6 383 0 384 3 385 4 386 5 387 6 388 0 389 3 390 4 391 5 392 6 393 1 394 3 395 4 396 5 397 6 398 4 399 5 400 6 401 5 402 6 403 0 404 3 405 4 406 5 407 6 408 1 409 3 410 4 411 5 412 6 413 8 414 9 415 10 416 11 417 8 418 9 419 10 420 11 421 8 422 9 423 10 424 11 425 8 426 9 427 10 428 11 429 12 430 13 431 14 432 15 433 12 434 13 435 14 436 15 437 12 438 13 439 14 440 15 441 12 442 13 443 14 444 15 445 9 446 10 447 11 448 8 449 9 450 10 451 11 452 9 453 10 454 11 455 8 456 9 457 10 458 11 459 13 460 14 461 15 462 12 463 13 464 14 465 15 466 12 467 13 468 14 469 15 470 13 471 14 472 15 473 7 474 8 475 12 476 16 477 17 478 7 479 8 480 12 481 16 482 17 483 7 484 8 485 12 486 16 487 17 488 7 489 8 490 12 491 16 492 17 493 7 494 8 495 12 496 16 497 17 498 7 499 8 500 12 501 16 502 17 503 7 504 8 505 12 506 16 507 17 508 7 509 8 510 12 511 16 512 17 513 7 514 8 515 12 516 16 517 17 518 7 519 8 520 12 521 16 522 17 523 7 524 8 525 12 526 16 527 17 528 7 529 8 530 12 531 16 532 17 533</v> </vertex_weights> </skin> </controller> </library_controllers> Greets
Benjamin
• By regnar
Hi!
I've been trying to implement simple virtual globe rendering system using "3D Engine Design for Virtual Globes" book as a reference.  What I do is I use 6 planes to form a cube, send it to GPU and use vertex shader to form a sphere and add random noise to simulate surface of the planet. The problem is how do I do CPU work on the vertex data from now on - how do I get world space coordinates of a terrain patch to perform LOD techniques, how do I do camera-terrain collision detection etc. ?

• I'm using WriteableBitmaps in my project, and the tiffbitmapencoder and tiffbitmapdecoder classes to save off and restore a certain large graphic file from a WriteableBitmap to hard disc (the image is too big for the PNGbitmapencoder/decoder).
This is working ok, but I'd like to encode to and decode from memory if possible, instead of having to save to disc. This is because, as part of the user experience this massive image can get wiped/cut down, and it takes a few precious seconds to reconstruct it again from scratch (which is also part of the user experience), but I can't afford the memory to just clone the whole image into another bitmap and clone it back again when needed, instead of rebuilding.
Compressing it to TIF and holding in memory until it's needed again seems a viable option, but currently I can only compress/decompress to/from a file on disc.
I've tried using MemoryStream instead of FileStream, and even though the encoder seems to like it, the decoder doesn't.
Is it possible for me to achieve this?