The interpolation looks fine. The main problem here is that the hash function you're using isn't very good. If I look at just one octave, and visualize the hash result by outputting hash(PT).x, I get something like this:
This is supposed to be completely random per grid square, but you can see that it has a lot of diagonal line patterns in it (it almost ...
JPEG compression involves three main steps:
Chroma subsampling. The image is converted from RGB into YCbCr color space, in which the luma or brightness (Y) is stored separately from the chroma or color components, Cb and Cr. The Y component is kept at full resolution, but Cb and Cr are downsampled, typically to half resolution on each axis. This exploits ...
The shadow terminator problem (as it's also known) is still something of an open problem in ray-tracing. As you say, disabling self-shadowing is not a very good workaround, because non-convex meshes often need to self-shadow. There's a possible refinement to this method. Instead of throwing away all shadow ray intersections with the same object, you can only ...
Short answer, set the precision of the image to a higher value.
When looking at a gamma correction curve, you can see that the lower values get changed much more, this means that the difference between lower values will get greater and that causes this effect. You have a limited amount of values for a color channel and this means that when it ...
Not enough triangles. The situation is analogous to the sampling theorem that states that you can not reconstruct a signal if your sample frequency is below a certain threshold. Although in this, case you're not attempting to rebuild the signal with a higher order filter so the result is even more dramatic. And it results in interpolation errors.
You can ...
Two things come to mind:
When generating your smaller mip map levels try to avoid using a simple 2x2 box filter because, though cheap and cheerful, they do a really poor job of removing high frequency information (that exceeds the Nyquist limit) as well as over filtering some of the lower frequency information you need to keep. (Also, as an aside, you need ...
So I followed Alan Wolfe suggestion (in comment to my question) And turned out he was right. I was using SamplerState.LinearWrap and that was the issue. When I changed this to AnisotropicWrap it looked much better. Below are some examples of different sampling types and how they affect texture:
graphicsDevice.SamplerStates = SamplerState.PointWrap;
Short answer: Move your near clip plane further away.
Depth buffer precision is very sensitive to the near clip plane distance.
Complicated answer: Use different math in your view projection. There are a few techniques that can help, some of them are outlined here:
The issue was caused by an incorrect calculation of the reflection direction vector.
With D ray direction and N the normal vector:
R = D - 2 * dot(D, N) * N
The issue was caused by calculating the components of R as follows:
R[i] = D[i] - 2 * (D[i] * N[i]) * N[i]
It took me a while to find the mistake because this produced a correct reflection with the ...
I think you are not constructing the index buffer correctly. Firstly you only need 1 degenerate vertex to terminate each triangle-strip row.
You also should not need any special handling for odd/even rows. You can emit a single triangle-strip per loop.
Your index loop should look something like :
var index:Int = 0
for i in 0..<rSimHeight - 1
It's a interference pattern, called Moire pattern. You get them in signal analysis and various other fields. I guess it could be considered an optical illusion.
To elaborate, this occurs when a periodic waveform goes out of phase with the observer. In your case the periodic waveform are the lines when observed as a scanline (from left to right of the ...
PNG format is lossless format where for compression the image is first "filtered" and this filtered image is then passed to DEFLATE lossless compression algorithm. The purpose of filtering stage is to make the image more compressible by DEFLATE and current method uses delta-compression from previously decoded pixels.
So if your plan is to pre-process the ...
I managed to solve my problem by increacing size of texture 2048x2048px so there would be generated more mipmaps. Also it seems like changing my SamplerState form anisotropic to something like that helped:
SamplerState MirrorTexCoord = new SamplerState()
AddressU = TextureAddressMode.Mirror,
AddressV = ...
Although it's not wrong to call it an interference pattern, it isn't the whole story here.
The difference between the dark and bright areas is caused by antialiasing (filtering) which is done in the wrong color space. The lines drawn as a single bright pixel (red=219) do not have the same apparent brightness as the lines drawn as two darker pixels (red=118)....
The pattern you are seeing arises from perspective projection. Which causes all those parallel lines not to be parallel to each other when projected on the screen.
Your problem with darker and lighter areas is caused by anti-aliasing which is trying to smooth the lines that are sometimes passing right in between 2 pixels, so it blends the lines with the ...
In computer typography, the technique for adjusting strokes so that they align with the pixel grid is called hinting.
The color artifacts you are seeing are due to another technique called subpixel rendering.