Comments (3)
Looking at the shader in more detail, it should end up contributing zero if the light is set to 0,0,0. If you don't call EnableDefaultLighting
, it ends up looking a lot more 'metal' than it should.
from directxtk12.
After reviewing the shader some more, I'm beginning to think it's not a bug after all. The 'specular radiance' is taken from the IBL and not based on the directional lights at all.
from directxtk12.
To be clear, if I change the LightSurface
function to this:
// Accumulate light values
for (int i = 0; i < numLights; i++)
{
if (step(dot(lightColor[i], lightColor[i]), EPSILON) > 0.f)
{
// light vector (to light)
const float3 L = normalize(-lightDirection[i]);
// Half vector
const float3 H = normalize(L + V);
// products
const float NdotL = saturate(dot(N, L));
const float LdotH = saturate(dot(L, H));
const float NdotH = saturate(dot(N, H));
// Diffuse & specular factors
float diffuse_factor = Diffuse_Burley(NdotL, NdotV, LdotH, roughness);
float3 specular = Specular_BRDF(alpha, c_spec, NdotV, NdotL, LdotH, NdotH);
// Directional light
acc_color += NdotL * lightColor[i] * (((c_diff * diffuse_factor) + specular));
}
}
It made no difference.
from directxtk12.
Related Issues (20)
- Retire VS 2017 support HOT 1
- DirectXTK emits a -Wreserved-identifier warning with clang v13
- Are d3d12sdklayers.dll symbols files available somewhere? HOT 1
- PostProcess Problem with Radeons 570 & 580 HOT 3
- VertexPositionNormal::InputLayout is undefined in the library HOT 1
- GenerateMips is causing TDR HOT 6
- New game available written using DirectXTK12 HOT 1
- Make namespace configurable (avoid conflict with D3D11 DirectXTK) HOT 4
- Xbox One "Line drawing and anti aliasing" Tutorial Requires IID_GRAPHICS_PPV_ARGS HOT 2
- WICTextureLoader and DDSTextureLoader feature request HOT 3
- GenerateMips on sRGB Textures averaging in gamma space? HOT 3
- Retire legacy Xbox One XDK support
- "Basic Game Loop" from supplied Win32 template results in invalid window regions after window resize HOT 6
- Havok Animation System HOT 1
- MSAAHelper file downloads download wrong version HOT 1
- Nuget package is not compiled with security protections HOT 3
- Wiki Issue for Getting Started -> Animating using model bones HOT 3
- Rust port of DirectXTK12, d3dx12 etc.
- Any plan for the C++ 20 modules support? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from directxtk12.