New answers tagged

1

I have fixed this problem through the following method. First, while generating noise values, I kept track of the minimum and maximum values. Second, when storing the noise values into my array, I normalized the data: (value - min)/(max - min). This way, all my values are between 0 and 1, but are better distributed. The equation maps the minimum value to (...


0

In some cases, you can use Google Static Maps API. This would let you to download sprites for specific locations one by one, and just use them as regular sprites/background in your game. However, you will need to deal with usage quota (depends on the API and use case, but probably 25000 requests per day for free) your game will be bound by Google Maps API ...


1

What I ultimately decided to do was to use a single material with all of the texture compiled together, and add a shader. The effect is as follows: The shader code is below. I added a texture of some pre-generated noise to let it work. Shader "Custom/Position Blur" { Properties{ _MainTex("Main", 2D) = "white"{} _BumpMap("Bumpmap", 2D) ...


1

You could interpolate and make the grid smaller. Basically the idea would be to take those large squares and make them smaller so that the edges are not so obvious. I posted the algorithm here with an example and some pretty pictures: Creating colour spectrum by light flux values Essentially, you would have to take your generated map data array -- and ...


2

My guess is you're trying to implement a camera, and should not be using SDL Viewports. The viewports are for UI elements like menus, minimaps, etc. It's a way of dividing up the screen into multiple areas. To implement a camera, you will want to think about coordinate systems. The world coordinates are the positions in the world, without thinking about the ...


-1

try using SDL_RenderSetClipRect() instead of SDL_RenderSetViewport . Had the same problem and changed into SDL_RenderSetClipRect(). Cheers!



Top 50 recent answers are included