Forward rendering with simple shadow mapping works now.
parent
54d67cdeac
commit
03a3b856d7
|
@ -82,7 +82,7 @@ void main() {
|
||||||
// diffuse lighting
|
// diffuse lighting
|
||||||
vec3 normal_dir = normalize(ioFragNormal);
|
vec3 normal_dir = normalize(ioFragNormal);
|
||||||
// vec3 light_dir = normalize(uLightDirection);
|
// vec3 light_dir = normalize(uLightDirection);
|
||||||
vec3 light_dir = transpose(inverse(mat3(uViewMatrix * uModelMatrix))) * uLightDirection;
|
vec3 light_dir = - transpose(inverse(mat3(uViewMatrix * uModelMatrix))) * uLightDirection;
|
||||||
float diff = max(dot(normal_dir, light_dir), 0.0);
|
float diff = max(dot(normal_dir, light_dir), 0.0);
|
||||||
vec4 diffuse = diff * albedo_color;
|
vec4 diffuse = diff * albedo_color;
|
||||||
|
|
||||||
|
|
|
@ -1141,9 +1141,9 @@ void Renderer::DrawGui() {
|
||||||
switch (sRendererSettings.RenderMode) {
|
switch (sRendererSettings.RenderMode) {
|
||||||
case SceneRenderModeDefault:
|
case SceneRenderModeDefault:
|
||||||
mRenderTextureRef.mTextureIdPtr =
|
mRenderTextureRef.mTextureIdPtr =
|
||||||
&mRenderTarget.mColorTexture;
|
// &mRenderTarget.mColorTexture;
|
||||||
// &mDeferredLightingTarget.mColorTexture;
|
// &mDeferredLightingTarget.mColorTexture;
|
||||||
// mUseDeferred ? &mDeferredLightingTarget.mColorTexture : &mRenderTarget.mColorTexture;
|
mUseDeferred ? &mDeferredLightingTarget.mColorTexture : &mRenderTarget.mColorTexture;
|
||||||
break;
|
break;
|
||||||
case SceneRenderModeColor:
|
case SceneRenderModeColor:
|
||||||
mRenderTextureRef.mTextureIdPtr = &mRenderTarget.mColorTexture;
|
mRenderTextureRef.mTextureIdPtr = &mRenderTarget.mColorTexture;
|
||||||
|
|
Loading…
Reference in New Issue