taisei/src/resource/material.h
Andrei Alexeyev e471837d4e
pbr: support ambient occlusion maps
AO maps modulate environment light
2021-09-01 00:48:59 +03:00

36 lines
889 B
C

/*
* This software is licensed under the terms of the MIT License.
* See COPYING for further information.
* ---
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@taisei-project.org>.
*/
#pragma once
#include "taisei.h"
#include "resource.h"
#include "texture.h"
typedef struct PBRMaterial {
Texture *diffuse_map;
Texture *normal_map;
Texture *ambient_map;
Texture *roughness_map;
Texture *depth_map;
Texture *ao_map;
vec3 diffuse_color;
vec3 ambient_color;
float roughness_value;
float metallic_value;
float depth_scale;
} PBRMaterial;
extern ResourceHandler material_res_handler;
#define MATERIAL_PATH_PREFIX "res/gfx/"
#define MATERIAL_EXTENSION ".material"
DEFINE_RESOURCE_GETTER(PBRMaterial, res_material, RES_MATERIAL)
DEFINE_OPTIONAL_RESOURCE_GETTER(PBRMaterial, res_material_optional, RES_MATERIAL)