mirror of
https://github.com/overte-org/overte.git
synced 2025-04-13 03:42:10 +02:00
Fixed compilation errors on Mac & Ubuntu
This commit is contained in:
parent
89ca7ac415
commit
b66aa4a742
2 changed files with 16 additions and 22 deletions
|
@ -418,7 +418,9 @@ void CubeMap::getFaceUV(const glm::vec3& dir, int* index, glm::vec2* uv) {
|
|||
auto isYPositive = dir.y > 0;
|
||||
auto isZPositive = dir.z > 0;
|
||||
|
||||
float maxAxis, uc, vc;
|
||||
float maxAxis = 1.0f;
|
||||
float uc = 0.0f;
|
||||
float vc = 0.0f;
|
||||
|
||||
// POSITIVE X
|
||||
if (isXPositive && absX >= absY && absX >= absZ) {
|
||||
|
@ -518,8 +520,8 @@ void CubeMap::generateGGXSamples(GGXSamples& data, float roughness, const int re
|
|||
const float mipBias = 3.0f;
|
||||
const auto sampleCount = data.points.size();
|
||||
const auto hammersleySequenceLength = data.points.size();
|
||||
int sampleIndex = 0;
|
||||
int hammersleySampleIndex = 0;
|
||||
size_t sampleIndex = 0;
|
||||
size_t hammersleySampleIndex = 0;
|
||||
float NdotL;
|
||||
|
||||
data.invTotalWeight = 0.0f;
|
||||
|
@ -636,14 +638,14 @@ void CubeMap::convolveMipFaceForGGX(const GGXSamples& samples, CubeMap& output,
|
|||
|
||||
glm::vec4 CubeMap::computeConvolution(const glm::vec3& N, const GGXSamples& samples) const {
|
||||
// from tangent-space vector to world-space
|
||||
glm::vec3 bitangent = abs(N.z) < 0.999 ? glm::vec3(0.0, 0.0, 1.0) : glm::vec3(1.0, 0.0, 0.0);
|
||||
glm::vec3 bitangent = std::abs(N.z) < 0.999 ? glm::vec3(0.0, 0.0, 1.0) : glm::vec3(1.0, 0.0, 0.0);
|
||||
glm::vec3 tangent = glm::normalize(glm::cross(bitangent, N));
|
||||
bitangent = glm::cross(N, tangent);
|
||||
|
||||
const size_t sampleCount = samples.points.size();
|
||||
glm::vec4 prefilteredColor = glm::vec4(0.0f);
|
||||
|
||||
for (int i = 0; i < sampleCount; ++i) {
|
||||
for (size_t i = 0; i < sampleCount; ++i) {
|
||||
const auto& sample = samples.points[i];
|
||||
glm::vec3 L(sample.x, sample.y, sample.z);
|
||||
float NdotL = L.z;
|
||||
|
|
|
@ -534,8 +534,8 @@ public:
|
|||
};
|
||||
#endif
|
||||
|
||||
void image::convertToFloatFromPacked(const unsigned char* source, int width, int height, size_t srcLineByteStride, gpu::Element sourceFormat,
|
||||
glm::vec4* output, size_t outputLinePixelStride) {
|
||||
void convertToFloatFromPacked(const unsigned char* source, int width, int height, size_t srcLineByteStride, gpu::Element sourceFormat,
|
||||
glm::vec4* output, size_t outputLinePixelStride) {
|
||||
glm::vec4* outputIt;
|
||||
auto unpackFunc = getHDRUnpackingFunction(sourceFormat);
|
||||
|
||||
|
@ -554,8 +554,8 @@ void image::convertToFloatFromPacked(const unsigned char* source, int width, int
|
|||
}
|
||||
}
|
||||
|
||||
void image::convertToPackedFromFloat(unsigned char* output, int width, int height, size_t outputLineByteStride, gpu::Element outputFormat,
|
||||
const glm::vec4* source, size_t srcLinePixelStride) {
|
||||
void convertToPackedFromFloat(unsigned char* output, int width, int height, size_t outputLineByteStride, gpu::Element outputFormat,
|
||||
const glm::vec4* source, size_t srcLinePixelStride) {
|
||||
const glm::vec4* sourceIt;
|
||||
auto packFunc = getHDRPackingFunction(outputFormat);
|
||||
|
||||
|
@ -576,10 +576,6 @@ void image::convertToPackedFromFloat(unsigned char* output, int width, int heigh
|
|||
|
||||
nvtt::OutputHandler* getNVTTCompressionOutputHandler(gpu::Texture* outputTexture, int face, nvtt::CompressionOptions& compressionOptions) {
|
||||
auto outputFormat = outputTexture->getStoredMipFormat();
|
||||
|
||||
nvtt::InputFormat inputFormat = nvtt::InputFormat_RGBA_32F;
|
||||
nvtt::WrapMode wrapMode = nvtt::WrapMode_Mirror;
|
||||
nvtt::AlphaMode alphaMode = nvtt::AlphaMode_None;
|
||||
bool useNVTT = false;
|
||||
|
||||
compressionOptions.setQuality(nvtt::Quality_Production);
|
||||
|
@ -620,12 +616,8 @@ void convertImageToHDRTexture(gpu::Texture* texture, Image&& image, BackendTarge
|
|||
|
||||
Image localCopy = image.getConvertedToFormat(Image::Format_RGBAF);
|
||||
|
||||
const int width = localCopy.getWidth(), height = localCopy.getHeight();
|
||||
auto mipFormat = texture->getStoredMipFormat();
|
||||
|
||||
nvtt::InputFormat inputFormat = nvtt::InputFormat_RGBA_32F;
|
||||
nvtt::WrapMode wrapMode = nvtt::WrapMode_Mirror;
|
||||
nvtt::AlphaMode alphaMode = nvtt::AlphaMode_None;
|
||||
const int width = localCopy.getWidth();
|
||||
const int height = localCopy.getHeight();
|
||||
|
||||
nvtt::OutputOptions outputOptions;
|
||||
outputOptions.setOutputHeader(false);
|
||||
|
@ -641,9 +633,9 @@ void convertImageToHDRTexture(gpu::Texture* texture, Image&& image, BackendTarge
|
|||
outputOptions.setOutputHandler(outputHandler.get());
|
||||
|
||||
nvtt::Surface surface;
|
||||
surface.setImage(inputFormat, width, height, 1, localCopy.getBits());
|
||||
surface.setAlphaMode(alphaMode);
|
||||
surface.setWrapMode(wrapMode);
|
||||
surface.setImage(nvtt::InputFormat_RGBA_32F, width, height, 1, localCopy.getBits());
|
||||
surface.setAlphaMode(nvtt::AlphaMode_None);
|
||||
surface.setWrapMode(nvtt::WrapMode_Mirror);
|
||||
|
||||
SequentialTaskDispatcher dispatcher(abortProcessing);
|
||||
nvtt::Compressor compressor;
|
||||
|
|
Loading…
Reference in a new issue