CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/GPU/Software/Lighting.h
Views: 1401
// Copyright (c) 2013- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include "TransformUnit.h"2021namespace Lighting {2223struct State {24struct {25// Pre-normalized if directional.26Vec3f pos;27Vec3f att;28Vec3f spotDir;29float spotCutoff;30float spotExp;3132Vec4<int> ambientColorFactor;33Vec4<int> diffuseColorFactor;34Vec4<int> specularColorFactor;3536struct {37bool enabled : 1;38bool spot : 1;39bool directional : 1;40bool poweredDiffuse : 1;41bool ambient : 1;42bool diffuse : 1;43bool specular : 1;44};45} lights[4];4647struct {48Vec4<int> ambientColorFactor;49Vec4<int> diffuseColorFactor;50Vec4<int> specularColorFactor;51} material;5253Vec4<int> baseAmbientColorFactor;54float specularExp;5556struct {57bool colorForAmbient : 1;58bool colorForDiffuse : 1;59bool colorForSpecular : 1;60bool setColor1 : 1;61bool addColor1 : 1;62bool usesWorldPos : 1;63bool usesWorldNormal : 1;64};65};6667void ComputeState(State *state, bool hasColor0);6869void GenerateLightST(VertexData &vertex, const WorldCoords &worldnormal);70void Process(VertexData &vertex, const WorldCoords &worldpos, const WorldCoords &worldnormal, const State &state);7172}737475