New answers tagged

0

Does Forward-Point shader compiles successfully? Does point light shader program (Program Object) links successfully? Do you call glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) before rendering? Have you enabled depth test (glEnable(GL_DEPTH_TEST))?


2

The way I fixed this is to go to the Lighting menu at Window > Lighting and configure the Lightmaps to Auto.


0

I found the answer: My game is actually very small but I resize it by a scale factor of 4. So I also have to divide the width and height of my bufferedimage by 4 inside the light render method public void render(Graphics2D g) { BufferedImage image = new BufferedImage(GamePanel.width / SCALE, GamePanel.height / SCALE, BufferedImage.TYPE_INT_ARGB);


0

You should scale your UV (float2 uv) to range [-1,+1] per x,y component. Now you are passing probably UV in range [0,+1]. Also don't forget to flip y coordinate. It should looks like something: float3 GetWP(float2 uv, float sceneDepth) { uv.y = 1-uv.y; //flipping y uv = uv*2-1; // scaling to [-1,+1] float4 position = float4(uv, sceneDepth, 1.0);...


0

Last time I checked the cel based approach was popular (and I believe minecraft does something similar) That said here's a previous answer to this problem: How can I implement lighting in a voxel engine?


0

Okay, after some hours of research, i finally ran into this site which work exactly how i wanted. The techique works as follows: Render the objects as usual into the G buffer so that the depth buffer will be properly populated. Disable writing into the depth buffer. From now on we want it to be read-only Disable back face culling. We want the ...



Top 50 recent answers are included