Files
WoWee/include/rendering/texture.hpp
Kelsi aeccddddeb Add centralized anisotropic filtering, fog, and Blinn-Phong specular to all renderers
Anisotropic filtering now queries GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT once
and applies via a single applyAnisotropicFiltering() utility, replacing
hardcoded calls across all renderers. Fog (sky horizon color, 100-600
range) and Blinn-Phong specular highlights are added to WMO, M2, and
character shaders for visual parity with terrain. Shadow sampling
plumbing (sampler2DShadow with 3x3 PCF) is wired into all three shaders
gated by uShadowEnabled, ready for a future shadow map pass.
2026-02-04 15:05:46 -08:00

39 lines
829 B
C++

#pragma once
#include <string>
#include <GL/glew.h>
namespace wowee {
namespace rendering {
class Texture {
public:
Texture() = default;
~Texture();
bool loadFromFile(const std::string& path);
bool loadFromMemory(const unsigned char* data, int width, int height, int channels);
void bind(GLuint unit = 0) const;
void unbind() const;
GLuint getID() const { return textureID; }
int getWidth() const { return width; }
int getHeight() const { return height; }
private:
GLuint textureID = 0;
int width = 0;
int height = 0;
};
/**
* Apply anisotropic filtering to the currently bound GL_TEXTURE_2D.
* Queries the driver maximum once and caches it. No-op if the extension
* is not available.
*/
void applyAnisotropicFiltering();
} // namespace rendering
} // namespace wowee