Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

Lighting in domain shader?

Do lighting for per several pixels instead of per pixel.

I think that per-pixel lighting is unneeded. I think that it's a better choice to do lighting per several pixels and interpolate the result to per-pixel. In DX11 we can generate primitives by tessellation, and each primitive covers several pixels. So we can do lighting in domain shader for each generated vertex, and blend the interpolated lighting result with textures and other stuff in pixel shader.

I also have tried rendering to a smaller sized texture, 1/2 sized, and then enlarging it to full screen. The lighting was good but aliasing was too heavy.

1 Reply
Adept I

Per-Vertex-Lighting is quite old and was used a long time before GPUs were powerful enough to do per-pixel-lighting. So it's nothing special.

The problem is that specular highlights are looking very ugly. You have to enormously increase the vertex density to overcome this problem. And this would also have an impact on the overall performance. In other words do per-pixel-lighting - it's better in most situations I think.