fixed the Point Light Flare positioning
--HG-- branch : nfb
This commit is contained in:
@@ -59,8 +59,8 @@ void KRPointLight::render(KRCamera *pCamera, std::vector<KRPointLight *> &point_
|
|||||||
float influence_radius = m_decayStart - sqrt(m_intensity * 0.01f) / sqrt(KRLIGHT_MIN_INFLUENCE);
|
float influence_radius = m_decayStart - sqrt(m_intensity * 0.01f) / sqrt(KRLIGHT_MIN_INFLUENCE);
|
||||||
|
|
||||||
KRMat4 sphereModelMatrix = KRMat4();
|
KRMat4 sphereModelMatrix = KRMat4();
|
||||||
sphereModelMatrix.scale(influence_radius);
|
|
||||||
sphereModelMatrix.translate(light_position.x, light_position.y, light_position.z);
|
sphereModelMatrix.translate(light_position.x, light_position.y, light_position.z);
|
||||||
|
sphereModelMatrix.scale(influence_radius);
|
||||||
|
|
||||||
if(viewport.visible(getBounds())) { // Cull out any lights not within the view frustrum
|
if(viewport.visible(getBounds())) { // Cull out any lights not within the view frustrum
|
||||||
|
|
||||||
|
|||||||
@@ -38,5 +38,5 @@ varying mediump vec2 texCoord;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
texCoord = vertex_uv;
|
texCoord = vertex_uv;
|
||||||
gl_Position = mvp_matrix * vec4(0.0, 0.0, 0.0, 1.0) + vec4(vertex_uv.x * viewport.w / viewport.z * 2.0 - 1.0, vertex_uv.y * 2.0 - 1.0, 0.0, 0.0) * flare_size;
|
gl_Position = mvp_matrix * vec4(0.0, 0.0, 0.0, 1.0) + vec4(vertex_uv.x * viewport.w / viewport.z * 2.0 - 0.75, vertex_uv.y * 2.0 - 1.0, 0.0, 0.0) * flare_size;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user