Tag Info

New answers tagged

2

I understand that you are at a loss. I also liked to hack pixels when I was young, and did some games on calculator devices, or dos era this way. This can still be done today, but, because of various hardware history of evolutions, it has become more involved. CPU pixel pushing Notably, we can still push pixels one by one, but it would be incredibly slow ...


2

I'm also from a pixel-banging background. PEEK and POKE anyone? Using a GPU is a different mind-set entirely. (Well, it's still code, so just "more of the same...) The GPU is really good at certain things: Processing individual pixels (through textures and fragment shaders), and filling triangles with pixels. Much effort (on the programmer's part) is ...


4

What you need is to retroproject the point on your map, from the inverse Mercator into 3d space, then place the sun as a directional light (not point like your image shows), and adjust the point for earth tilting (according to earth-sun rotation plane), then you can evaluate the light. It will automatically give you the weird valley shape that we see in ...


0

replace your whole if-statement with this: float vstep = step( u_bgColor.r, texColor.r); texColor.a = mix(0.1, u_lightIntensity/10.0, vstep); mix will select either the 1st argument of the mix if vstep == 0, or the 2nd otherwise (which is vstep == 1)


1

screenPosition is not at the right scale for texture coordinate lookup. Texture2D::Sample expects texture coordinates (0..1) while Texture2D::Load expects texel coordinates (0..[Width or Height]-1). So you're probably sampling way off the edge of the texture and either hitting the border color, or clamping to the edge which happens to be black. As a ...



Top 50 recent answers are included