chaosgroup / vraymtl_glsl Goto Github PK
View Code? Open in Web Editor NEWA reference GLSL implementation of the VRayMtl material
License: MIT License
A reference GLSL implementation of the VRayMtl material
License: MIT License
in function 'vec3 getGGXDir()' in vratmtl_glsl microNormalLocal was scaled before get reflect dir. Then you pass this scaled microNormalLocal to 'getGGXContribution()', and in this function the microNormalLocal was scaled again to calculate BRDF.
is it right to scale this vector twice?
Are threre plans to support or partially support these unsupported features in the future ?
Unsupported features:
Glossy Fresnel (supported only in sheen) because the calculations are a bit heavy for real-time rendering.
SSS and fog parameters
Normal/Bump Mapping - this is outside of the scope of the current implementation because the normal is usually computed separately before any BRDF calculations
Shadows, AO and other global illumination effects - outside of the scope of the current implementation
Displacement
vec3 vrayMtlDiffuse(vec3 lightDir, vec3 normal) {
return vec3(max(0.0, dot(lightDir, normal)));
}
vec3 computeDirectDiffuseContribution(VRayMtlInitParams params, VRayMtlContext ctx, vec3 lightDir) {
vec3 res = vec3(0.0);
if (params.roughness < 1e-6) {
res = vrayMtlDiffuse(lightDir, ctx.geomNormal);
} else {
res = vrayMtlDiffuseRoughness(lightDir, ctx);
}
if (ctx.hasSheen) {
vec3 sheenLightDim = getSheenAlbedoLightDim(params.sheenColor, dot(lightDir, ctx.geomNormal), ctx.sheenGloss);
res *= sheenLightDim;
}
return res;
}
i cannot find a π division at this function, according to formula, should res to divided by π at the end?
any tips on reproducing the max depth option in VRayMtl?
couldn't find it here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.