Tag Info

New answers tagged

0

I solved this with some help from Nathan Reed in the comments of this SO answer. The blend function glBlendFunc(GL_ONE, GL_ONE) is purely additive, and because addition is commutative, order doesn't matter. However, what does matter is to establish depth in the z-buffer through an opaque pass before doing any blending. My solution was to simply disable ...


0

Yes,you are right. If your program needs any buffer texture to draw result(like light accumulation buffer in light pre-pass rendering),you needs to care about order of objects in scene. Because texture can store only one pixel for a fragment. It means texture can't store any data behind of an object when the texture store the data of most nearest(of course ...


2

One way to apply light effects with the Context2D is to use the composite operation 'lighter' (globalCompositeOperation='ligther'), and adjust the alpha (globalAlpha= 0.0 to 1.0). Then you can either : • Draw the shape of the light with several geometric drawings that create a simple shade to get a cartoonish light effect. • Define gradients to get a ...


0

Take a look at a few of these and see if they match what you're looking for. I let attenuation = 10 for the purpose of demonstrating, but you should play around with all the numbers involved. WolframAlpha is very good at visualizing this sort of thing. Keep in mind, negative exponents probably are not what you're looking for. Inverse squares, or negative ...


0

Maybe i dont understand what you are trying to do, but the standard way to do this is to have a spot light as your flash light. In your case you would disable all lighting sources in the scene and set global ambient lighting to 0. This will make the scene pitch black where only the spot light attached to the player visible. For 2d you will need to add ...


1

Instead of casting rays in 360 degree fashion, cast rays to the corners of the tiles in range of the lightsource. Sort the angles from the light source to the tile corners and do a 'sweep'. You can optimize the algorithm to look for the nearest tiles first and ignore angles for culled tiles: A--B E--F o |T1| |T2| C--D G--H Angles would be ...


0

I don't exactly understand how would ray-tracing change anything, here is how it usually goes: You can have a texture for any parameter you like, but the most common is a diffuse(color) map, so you just sample this based on the texture coordinates and use the texture in place of the single-color diffuse. You could also combine the texture with an arbitrary ...


2

There are additional alignment and layout rules for constant buffers. The float3 probably needs padding on the CPU side to get the right stride. Roughly paraphrased, things need to be on 16-byte boundaries.



Top 50 recent answers are included