This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************************* | |
* | |
* raylib [core] example - Initialize 3d camera mode | |
* | |
* This example has been created using raylib 1.0 (www.raylib.com) | |
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) | |
* | |
* Copyright (c) 2014 Ramon Santamaria (@raysan5) | |
* | |
********************************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MicrocylinderClothMaterial : public IMaterial { | |
public: | |
glm::dvec3 tangentu; | |
glm::dvec3 tangentv; | |
glm::dvec3 bxdf(const glm::dvec3 &wo, const glm::dvec3 &wi) const override { | |
if (glm::dot(Ng, wi) < 0.0 || glm::dot(Ng, wo) < 0.0) { | |
return glm::dvec3(0.0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MicrocylinderClothMaterial : public IMaterial { | |
public: | |
glm::dvec3 tangentu; | |
glm::dvec3 tangentv; | |
glm::dvec3 bxdf(const glm::dvec3 &wo, const glm::dvec3 &wi) const override { | |
if (glm::dot(Ng, wi) < 0.0 || glm::dot(Ng, wo) < 0.0) { | |
return glm::dvec3(0.0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <glm/glm.hpp> | |
#include <glm/ext.hpp> | |
namespace rt { | |
#define MICROCYLINDER_ASSERT_ENABLE 1 | |
#if MICROCYLINDER_ASSERT_ENABLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector rd = normalize(set(-1, ch("dirY"), 0)); | |
vector ro = @P; | |
int prim = addprim(0, "polyline"); | |
addvertex(geoself(), prim, @ptnum); | |
float ior = ch("ior"); | |
for(int i = 0 ; i < 20; ++i) { | |
vector p; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline double normalized_gaussian(double beta, double theta) { | |
return std::exp(-theta * theta / (2.0 * beta * beta)) / (std::sqrt(glm::two_pi<double>()) * beta); | |
} | |
inline double Nr(double phi_d) { | |
return 0.25 * std::cos(phi_d * 0.5); | |
} | |
inline double Mr(double theta_h, double gamma_s) { | |
return normalized_gaussian(gamma_s, theta_h); | |
} | |
inline double bsdf(glm::vec3 u, glm::vec3 wi, glm::vec3 wo, double beta, double *cosThetaI) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if NDEBUG | |
#define RT_ASSERT(expect_true) ; | |
#else | |
#define RT_ASSERT(expect_true) if((expect_true) == 0) { __debugbreak(); } | |
#endif | |
inline double normalized_gaussian(double beta, double theta) { | |
return std::exp(-theta * theta / (2.0 * beta * beta)) / (std::sqrt(glm::two_pi<double>() * beta * beta)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <algorithm> | |
#include <glm/glm.hpp> | |
#include <glm/ext.hpp> | |
namespace rt { | |
class SphericalTriangleSampler { | |
public: | |
/* | |
a, b, c はポリゴンの頂点 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections.Generic; | |
using UnityEngine.UI; | |
public class Polygon2DRenderer : Graphic | |
{ | |
public Transform _Mesh; | |
protected override void OnPopulateMesh(VertexHelper vh) | |
{ |
NewerOlder