Comments (5)
ok i figured out ! i was applying a scale a root node level in the gltf file that was misleading the shadow calculations, the solution was to apply scale directly at vertex level, and then exporting to gltf
from lighthouse2.
it seems while applying a scale to the model ( ex 0.5,0.5,0.5 ), that the source matrix calculation is causing incorrect results for shadows/shade/ambient:
in rendercore.cpp
if (instance->transform)
{
T = mat4::Identity();
memcpy( &T, instance->transform , 12* sizeof( float ) );
invT = T.Inverted();
}
else
{
T = mat4::Identity();
invT = mat4::Identity();
}
if i use only:
T = mat4::Identity();
invT = mat4::Identity();
the shadows/ambient are working
could you comfirm you have the same behaviour with the gltf model provided ? with rendercore optix 7.0.
how can i make model transform scale work ? thx
from lighthouse2.
ok i created a pull request for that, let me know if it goes through, thx
from lighthouse2.
Sorry for the late reply, I missed your comment.
I think the issue is a bit deeper: when using a transform on instances the shading code must take this into account for normals by applying the same transform to these vectors. Or more accurately, to obtain corect transformed normals the inverse of the transpose of the transform must be applied. This is the same as the transform itself for orthonormal matrices, but scale matrices are not orthonormal...
I will fix this in the new year. In the meantime: the fix you proposed will not work if the model is rotated, but for now it should indeed solve your problem.
from lighthouse2.
I have committed a couple of fixes that should resolve your problem. I will close the issue now; if it turns out your problem persists please reopen it.
from lighthouse2.
Related Issues (20)
- normal maps, mdl materials HOT 3
- freetype.dll was not found HOT 1
- Error building the pbrtdemoapp HOT 1
- A small bug in the pbrtdemoapp.
- Thanks HOT 1
- Materials do not interactively change in imguiapp and viewerapp
- Error when running on Maxwell card
- 3dsmax OctaneRender report errors HOT 1
- I got a fetal error while running (building is okay)
- Create DOI for the repository
- Visual artifacts with high sample count
- Optix error unsupported ABI version HOT 6
- Which CUDA?
- Please support MSYS2 MINGW64
- Broken RenderCore_Minimal
- NaN in PackNormal compression HOT 1
- Project not building Debug x64 HOT 1
- Correct CUDA Version? HOT 1
- vulkan compile error HOT 2
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 lighthouse2.