-
Notifications
You must be signed in to change notification settings - Fork 65
Dummy PR to keep everyone's contributor status #547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devshgraphicsprogramming
wants to merge
69
commits into
master
Choose a base branch
from
give_credit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
d3f4169
Add files via upload
nahiim 95cc93f
Update animtation.hlsl
nahiim 507b1a6
Update keyframe.hlsl
nahiim bcb9f77
Update node.hlsl
nahiim b9b29d2
Add files via upload
nahiim 6d7e989
Delete animtation.hlsl
nahiim 6c24d2c
Update node.hlsl
nahiim ef4f253
Add files via upload
nahiim b89cad1
Delete node.hlsl
nahiim c964e09
Add files via upload
nahiim bb088e9
Update keyframe.hlsl
nahiim 2e65bbc
brdf
nahiim cc39ce3
geom smith
nahiim 9f18406
fixed minor math blunder
nahiim bfc2143
...
nahiim c80b0e9
Shapes and ieee754
nahiim 321b252
numeric_limits
nahiim b5d3a4c
colorspace_EOTF
nahiim 4ecbd7c
colorspace completed
nahiim 8eec0c0
fixed typos
nahiim e644e74
Create HLSL_NABLA_COMPILE_TEST target for compile-testing Nabla's new…
AnastaZIuk 8135e46
Find a way to clean environment for clear DXC compilation, make sure …
AnastaZIuk 4712763
link dxcompiler library to Nabla
AnastaZIuk a215ee3
add dxc as dependency of HLSL_NABLA_COMPILE_TEST
AnastaZIuk 9dd660f
math
nahiim 255f8e8
maths
nahiim 42b19d7
Merge remote-tracking branch 'origin/hlsl' into local_hlsl
nahiim 95e9e2d
Merge remote-tracking branch 'origin/dxcIntegration' into local_hlsl
nahiim f01eeee
minor fixes
nahiim cbf8d71
automated HLSL compilation
nahiim 1990c18
complex and constants
nahiim 953b681
math completed
nahiim 7011441
shapes completed
nahiim a09b8ef
create random/xoroshiro.hlsl
nahiim d5e3189
porting hlsl/utils
nahiim b3a17c9
add hlsl/utils/culling
nahiim 47c82ce
add morton, normal_encode, normal_decode, culling
nahiim f037e69
utils
nahiim 5f70cca
surface_transform finishing
nahiim 67b22f0
add utils/transform
nahiim 9cfc8fb
update transform.hlsl
nahiim 0efa057
utils, loader, property_pool, blit
nahiim 9720334
Seems like all BRDF functions are ported to HLSL and compiling ok
Crisspl bb6ec81
ported bsdf functions to HLSL
Crisspl 52589d2
Reworked & renamed bxdf functions to _quotient_and_pdf convention
Crisspl e2daa63
HLSL BxDF concepts design: common bxdf classes
Crisspl 6853d83
HLSL BxDF concepts design: some work done on NDFs
Crisspl a49760c
Typo and missing create() for blinnphong
Crisspl 758a390
Fresnels
Crisspl 5e2bf89
Diffuse BxDFs
Crisspl 915ef27
Generic CookTorrance BRDF implementation
Crisspl c81e7ab
Merge pull request #475 from Crisspl/local_hlsl
devshgraphicsprogramming cf68dd5
Delete include/nbl/builtin/hlsl/math/binary_operator_functions.hlsl
devshgraphicsprogramming 2b9f418
Update complex.hlsl
devshgraphicsprogramming 0b5adfa
Resolved conflicts
Przemog1 1a87eb3
Merge branch 'type_traits' of https://github.com/Devsh-Graphics-Progr…
Przemog1 011af04
Merge branch 'master' of https://github.com/Devsh-Graphics-Programmin…
Przemog1 0f44f7c
Deleted xoutput (#554)
Przemog1 2fa14cf
Resolved conflicts
Przemog1 5190699
Deleted old files
Przemog1 b8a4bdd
Merge pull request #566 from Devsh-Graphics-Programming/give_credit_new
Przemog1 03f876e
Resolved conflicts
Przemog1 7eab08e
Resolved conflicts
Przemog1 4bb3160
Merge pull request #569 from Devsh-Graphics-Programming/give_credit_new
Przemog1 ae47657
remove BxDF stuff that's been rewritten since
57ecc75
remove more stuff redone on other branches
02630e6
Merge branch 'master' into give_credit
989f5d9
remove one more duplicate/rewritten file
3193d41
and remove some more duplicates
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule EGL
added at
9eeb49
Submodule SPIRV-Headers
added at
b8047f
Submodule SPIRV-Tools
added at
75e53b
Submodule radeonrays
added at
e42145
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
|
||
// Copyright (C) 2018-2023 - DevSH Graphics Programming Sp. z O.O. | ||
// This file is part of the "Nabla Engine". | ||
// For conditions of distribution and use, see copyright notice in nabla.h | ||
#ifndef _NBL_BUILTIN_HLSL_MATH_COMPLEX_INCLUDED_ | ||
#define _NBL_BUILTIN_HLSL_MATH_COMPLEX_INCLUDED_ | ||
|
||
#include <nbl/builtin/hlsl/math/constants.hlsl> | ||
|
||
|
||
namespace nbl | ||
{ | ||
namespace hlsl | ||
{ | ||
namespace math | ||
{ | ||
|
||
|
||
template<typename vector_t> | ||
struct complex_t | ||
{ | ||
// TODO: do it properly as an `exp` and `exp2` overload/shadow func | ||
complex_t<vector_t> expImaginary(in float _theta) | ||
{ | ||
complex_t<vector_t> result; | ||
result.real = cos(_theta); | ||
result.imaginary = sin(_theta); | ||
return result; | ||
} | ||
|
||
complex_t<vector_t> operator+(const complex_t<vector_t> other) | ||
{ | ||
complex_t<vector_t> result; | ||
result.real = real + other.real; | ||
result.imaginary = imaginary + other.imaginary; | ||
return result; | ||
} | ||
|
||
complex_t<vector_t> operator-(const complex_t<vector_t> other) | ||
{ | ||
complex_t<vector_t> result; | ||
result.real = real - other.real; | ||
result.imaginary = imaginary - other.imaginary; | ||
return result; | ||
} | ||
|
||
complex_t<vector_t> operator*(const complex_t<vector_t> other) | ||
{ | ||
complex_t<vector_t> result; | ||
result.real = real * other.real - imaginary * other.imaginary; | ||
result.imaginary = real * other.real + imaginary * other.imaginary; | ||
return result; | ||
} | ||
|
||
complex_t<vector_t> conjugate() | ||
{ | ||
complex_t<vector_t> result; | ||
result.real = real; | ||
result.imaginary = -imaginary; | ||
return result; | ||
} | ||
|
||
vector_t real, imaginary; | ||
}; | ||
|
||
|
||
// TODO: move to its own header | ||
namespace fft | ||
{ | ||
|
||
template<typename scalar_t> | ||
complex_t<scalar_t> twiddle(in uint k, in float N) | ||
{ | ||
complex_t<scalar_t> retval; | ||
retval.x = cos(-2.f*PI*float(k)/N); | ||
retval.y = sqrt(1.f-retval.x*retval.x); // twiddle is always half the range, so no conditional -1.f needed | ||
return retval; | ||
} | ||
|
||
template<typename scalar_t> | ||
complex_t<scalar_t> twiddle(in uint k, in uint logTwoN) | ||
{ | ||
return twiddle<scalar_t>(k,float(1u<<logTwoN)); | ||
} | ||
|
||
template<typename scalar_t> | ||
complex_t<scalar_t> twiddle(in bool is_inverse, in uint k, in float N) | ||
{ | ||
complex_t<scalar_t> twiddle = twiddle(k,N); | ||
if (is_inverse) | ||
return twiddle.conjugate; | ||
return twiddle; | ||
} | ||
|
||
template<typename scalar_t> | ||
complex_t<scalar_t> twiddle(in bool is_inverse, in uint k, in uint logTwoN) | ||
{ | ||
return twiddle<scalar_t>(is_inverse,k,float(1u<<logTwoN)); | ||
} | ||
|
||
|
||
|
||
// decimation in time | ||
template<typename scalar_t, typename vector_t> | ||
void DIT_radix2(in complex_t<scalar_t> twiddle, inout complex_t<vector_t> lo, inout complex_t<vector_t> hi) | ||
{ | ||
complex_t<vector_t> wHi = hi * twiddle; | ||
hi = lo-wHi; | ||
lo += wHi; | ||
} | ||
|
||
// decimation in frequency | ||
template<typename scalar_t, typename vector_t> | ||
void DIF_radix2(in complex_t<scalar_t> twiddle, inout complex_t<vector_t> lo, inout complex_t<vector_t> hi) | ||
{ | ||
complex_t<vector_t> diff = lo-hi; | ||
lo += hi; | ||
hi = diff * twiddle; | ||
} | ||
|
||
|
||
} | ||
|
||
// TODO: radices 4,8 and 16 | ||
|
||
} | ||
} | ||
} | ||
|
||
|
||
|
||
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
|
||
// Copyright (C) 2018-2022 - DevSH Graphics Programming Sp. z O.O. | ||
// This file is part of the "Nabla Engine". | ||
// For conditions of distribution and use, see copyright notice in nabla.h | ||
|
||
#ifndef _NBL_BUILTIN_GLSL_MATH_QUATERNIONS_INCLUDED_ | ||
#define _NBL_BUILTIN_GLSL_MATH_QUATERNIONS_INCLUDED_ | ||
|
||
|
||
namespace nbl | ||
{ | ||
namespace hlsl | ||
{ | ||
namespace math | ||
{ | ||
|
||
|
||
struct quaternion_t | ||
{ | ||
float4 data; | ||
|
||
|
||
static quaternion_t constructFromTruncated(in float3 first3Components) | ||
{ | ||
quaternion_t quat; | ||
quat.data.xyz = first3Components; | ||
quat.data.w = sqrt(1.0-dot(first3Components,first3Components)); | ||
return quat; | ||
} | ||
|
||
static quaternion_t lerp(in quaternion_t start, in quaternion_t end, in float fraction, in float totalPseudoAngle) | ||
{ | ||
const uint negationMask = asuint(totalPseudoAngle) & 0x80000000u; | ||
const float4 adjEnd = asfloat(asuint(end.data)^negationMask); | ||
|
||
quaternion_t quat; | ||
quat.data = lerp(start.data, adjEnd, fraction); | ||
return quat; | ||
} | ||
static quaternion_t lerp(in quaternion_t start, in quaternion_t end, in float fraction) | ||
{ | ||
return lerp(start,end,fraction,dot(start.data,end.data)); | ||
} | ||
|
||
static float flerp_impl_adj_interpolant(in float angle, in float fraction, in float interpolantPrecalcTerm2, in float interpolantPrecalcTerm3) | ||
{ | ||
const float A = 1.0904f + angle * (-3.2452f + angle * (3.55645f - angle * 1.43519f)); | ||
const float B = 0.848013f + angle * (-1.06021f + angle * 0.215638f); | ||
const float k = A * interpolantPrecalcTerm2 + B; | ||
return fraction+interpolantPrecalcTerm3*k; | ||
} | ||
|
||
static quaternion_t flerp(in quaternion_t start, in quaternion_t end, in float fraction) | ||
{ | ||
const float pseudoAngle = dot(start.data,end.data); | ||
|
||
const float interpolantPrecalcTerm = fraction-0.5f; | ||
const float interpolantPrecalcTerm3 = fraction*interpolantPrecalcTerm*(fraction-1.f); | ||
const float adjFrac = quaternion_t::flerp_impl_adj_interpolant(abs(pseudoAngle),fraction,interpolantPrecalcTerm*interpolantPrecalcTerm,interpolantPrecalcTerm3); | ||
quaternion_t quat = quaternion_t::lerp(start,end,adjFrac,pseudoAngle); | ||
quat.data = normalize(quat.data); | ||
return quat; | ||
} | ||
|
||
static float3x3 constructMatrix(in quaternion_t quat) | ||
{ | ||
float3x3 mat; | ||
mat[0] = quat.data.yzx*quat.data.ywz+quat.data.zxy*quat.data.zyw*float3( 1.f, 1.f,-1.f); | ||
mat[1] = quat.data.yzx*quat.data.xzw+quat.data.zxy*quat.data.wxz*float3(-1.f, 1.f, 1.f); | ||
mat[2] = quat.data.yzx*quat.data.wyx+quat.data.zxy*quat.data.xwy*float3( 1.f,-1.f, 1.f); | ||
mat[0][0] = 0.5f-mat[0][0]; | ||
mat[1][1] = 0.5f-mat[1][1]; | ||
mat[2][2] = 0.5f-mat[2][2]; | ||
mat *= 2.f; | ||
return mat; | ||
} | ||
}; | ||
|
||
float3 slerp_delta_impl(in float3 start, in float3 preScaledWaypoint, in float cosAngleFromStart) | ||
{ | ||
float3 planeNormal = cross(start,preScaledWaypoint); | ||
|
||
cosAngleFromStart *= 0.5; | ||
const float sinAngle = sqrt(0.5-cosAngleFromStart); | ||
const float cosAngle = sqrt(0.5+cosAngleFromStart); | ||
|
||
planeNormal *= sinAngle; | ||
const float3 precompPart = cross(planeNormal,start)*2.0; | ||
|
||
return precompPart*cosAngle+cross(planeNormal,precompPart); | ||
} | ||
|
||
float3 slerp_impl_impl(in float3 start, in float3 preScaledWaypoint, in float cosAngleFromStart) | ||
{ | ||
return start + slerp_delta_impl(start,preScaledWaypoint,cosAngleFromStart); | ||
} | ||
|
||
|
||
|
||
} | ||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevyuu @keptsecret this file might be useful to you, but I can't guarantee correctness, so rewrite anyway but look at the ideas.