Currently we do not have a PixelShader to render images with a point light source.
This implements a pixel shader with lambertian shading and a point light source.
Example code to see the influence of a point light source with respect to the distance to the mesh:
val mesh: VertexColorMesh3D = ???
val param = RenderParameter.defaultSquare
for(z <- -850 to -200 by 100) {
val buffer = ZBuffer[RGBA](param.imageSize.width, param.imageSize.height, RGBA.BlackTransparent)
val renderingPointLight = TriangleRenderer.renderMesh(mesh.shape, param.pointShader,
LambertPointLightShader.pixelShader(ColorNormalMesh3D(mesh), param, RGB(0.5), RGB(0.5), Point(0,0,z)), buffer)
PixelImageIO.write(renderingPointLight.toImage, new File(s"/tmp/pointLight_${z}.png")).get
}
Currently we do not have a PixelShader to render images with a point light source. This implements a pixel shader with lambertian shading and a point light source.
Example code to see the influence of a point light source with respect to the distance to the mesh: