mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Implementation of reflection and skylight probes.
Moves lighting math to the diffuse/specular two-channel logic.
This commit is contained in:
parent
1f7cf55204
commit
b19a4b22c8
102 changed files with 12346 additions and 1911 deletions
30
Engine/source/T3D/lighting/IBLUtilities.h
Normal file
30
Engine/source/T3D/lighting/IBLUtilities.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
namespace IBLUtilities
|
||||
{
|
||||
void GenerateIrradianceMap(GFXTextureTargetRef renderTarget, GFXCubemapHandle cubemap, GFXCubemapHandle &cubemapOut);
|
||||
|
||||
void GeneratePrefilterMap(GFXTextureTargetRef renderTarget, GFXCubemapHandle cubemap, U32 mipLevels, GFXCubemapHandle &cubemapOut);
|
||||
|
||||
void GenerateBRDFTexture(GFXTexHandle &textureOut);
|
||||
|
||||
void bakeReflection(String outputPath, S32 resolution);
|
||||
|
||||
LinearColorF decodeSH(Point3F normal, const LinearColorF SHTerms[9], const F32 SHConstants[5]);
|
||||
|
||||
MatrixF getSideMatrix(U32 side);
|
||||
|
||||
F32 harmonics(U32 termId, Point3F normal);
|
||||
|
||||
LinearColorF sampleSide(GBitmap* cubeFaceBitmaps[6], const U32& cubemapResolution, const U32& termindex, const U32& sideIndex);
|
||||
|
||||
//
|
||||
//SH Calculations
|
||||
// From http://sunandblackcat.com/tipFullView.php?l=eng&topicid=32&topic=Spherical-Harmonics-From-Cube-Texture
|
||||
// With shader decode logic from https://github.com/nicknikolov/cubemap-sh
|
||||
void calculateSHTerms(GFXCubemapHandle cubemap, LinearColorF SHTerms[9], F32 SHConstants[5]);
|
||||
|
||||
F32 texelSolidAngle(F32 aU, F32 aV, U32 width, U32 height);
|
||||
|
||||
F32 areaElement(F32 x, F32 y);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue