New answers tagged

3

context.clearRect() has a method signature of: context.clearRect(x, y, width, height) In your code, however, you are passing the height and width in the incorrect positions. Changing your call to context.clearRect(0, 0, canvas.width, canvas.height) fixes the issue. MDN clearRect() documentation.


1

I just received an answer from the Unity Answers forum. It pointed out that I should've tried to disable the mipmaps on the sprites. After disabling them everything worked flawlessly.


1

This technique is called MRT'S or Multiple Render Targets, and employs the use of additional Framebuffers. Why is this used? Because when wanting to achieve certain screen space effects, whether it is screen space lighting or ambient occlusion, it is quite efficient to store certain scene parameters as textures. Imagine a scene with hundreds of lights ...


0

I recently encountered this problem 2nd time. I think it is a bug of Unity. Well, surprisingly the solution is out of the box. Solution is also like bug, silly bug silly solution. Right now your camera is definitely at Z:-10 move it to -1.... something and change Clipping Planes to Near: 0.3 Far 3. May be this exact solution may not resolve your problem, ...


0

Actually Unity create a default material for meshes if you don't assign any material explicitly. And the Rendering Mode of that default material is set to Opaque that prevents you to play with transparency. Although _Color property is declared in Standard Shader. Means your code is right. Well, it's totally another topic. What you can do is to create your ...


3

There are two possibilities I can come up with that don't involve ordinary planar reflection. The first is to perform screen-space reflection, which is fairly cheap and works for any manner of surface. However, it will be prone to artifacts, and of course it will not be able to reflect objects that are not visible from the regular point of view. The other ...


-4

Render it with layers of pixels for each layer of water


0

I found that rendering dynamic Entity-textures in XNA such as cubes or "planes" needs alot of HLSL knowledge, how to throw in shaders and more. I scrapped my XNA project and started with Java OpenGL "LWJGL". ThinMatrix had a good tutorial series with a quick runtrough of the glsl shader system. with "dynamic" I meant rendering and changing the ...


0

You would have to render your scene into a cube map, then render a quad. The texture coordinates would then translate directly to longitude/latitude you can use to calculate the vector to use for sampling the cube map. For equirectangular projection: lon = u*2*pi lat = (v*2-1)*2*pi x = cos(lon)*cos(lat) y = sin(lon)*cos(lat) z = sin(lat) Where u/v are ...


2

Unity's built-in frustum and occlusion culling features work on a per-renderer level. They'll disable the rendering of whole objects that can't be seen, but they don't select individual triangles to cull out of a single mesh. In both your examples above, the full mesh will be processed by the GPU, because at least part of it is visible. The extra vertices ...


1

Create your mipmapped texture as a rendertarget. Then grab the surfaces of each Mip level you want to render to like this: D3DXCreateTexture( device, width, height, numMips, D3DUSAGE_RENDERTARGET, texFormat, D3DPOOL_DEFAULT, &texture ); texture->GetSurfaceLevel( 0, &mipLevel0 ); texture->GetSurfaceLevel( 1, &mipLevel1 ); ...


0

The singular value decomposition produces the Eigenvalues with largest magnitude, and their corresponding Eigenvectors. If one were to decompose every Eigenvector of a matrix, they have performed a Principle Component Analysis. The principal components represent the 'n'-dimensional axes on which the most variance is encoded. Therefore they can be used as ...


4

Actually every face of your mesh has UV coordinates through which UV mapping works. Let take an example of cube. Cube has 6 faces and every face has 4 coordinates. That means a Cube must have 24 coordinates for UV mapping. Now second part is to map coordinates with texture. Let's take an example of a square texture image having 6 different color boxes ( ...


0

Solved by using vsync. private static AppGameContainer gameApp; gameApp.setVSync(true);



Top 50 recent answers are included