Skip to content

Commit 6794bb1

Browse files
authored
Merge pull request #1 from PixelClear/featureObjMeshLoader
Feature obj mesh loader
2 parents 70b05b6 + 05a0082 commit 6794bb1

24 files changed

+15813
-3
lines changed

RadeonProRender/inc/Math/float3.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVE
1616

1717
#pragma once
1818

19+
#include <iostream>
1920
#include <cmath>
2021
#include <algorithm>
2122

@@ -38,12 +39,18 @@ namespace RadeonProRender
3839
float3& operator *= (float3 const& o) { x*=o.x; y*=o.y; z*= o.z; return *this;}
3940
float3& operator *= (float c) { x*=c; y*=c; z*= c; return *this;}
4041
float3& operator /= (float c) { float cinv = 1.f/c; x*=cinv; y*=cinv; z*=cinv; return *this;}
41-
42+
friend std::ostream& operator<<(std::ostream& os, const float3& o);
43+
4244
float x, y, z, w;
4345
};
4446

4547
typedef float3 float4;
4648

49+
std::ostream& operator<<(std::ostream& os, const float3& o)
50+
{
51+
os << "[" << o.x << ", " << o.y << ", " << o.z << ", " << o.w << "]";
52+
return os;
53+
}
4754

4855
inline float3 operator+(float3 const& v1, float3 const& v2)
4956
{
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# The sphere Cornell Box as seen in Henrik Jensen's
2+
# "Realistic Image Synthesis Using Photon Mapping" (Page 107 Fig. 9.10) in OBJ format.
3+
# Note that the real box is not a perfect cube, so
4+
# the faces are imperfect in this data set.
5+
#
6+
# Created by Guedis Cardenas and Morgan McGuire at Williams College, 2011
7+
# Released into the Public Domain.
8+
#
9+
# http://graphics.cs.williams.edu/data
10+
# http://www.graphics.cornell.edu/online/box/data.html
11+
# http://www.cs.cmu.edu/~djames/15-864/pics/cornellBox.jpg
12+
#
13+
14+
15+
newmtl leftSphere
16+
Ka 0.01 0.01 0.01
17+
Kd 0.01 0.01 0.01
18+
Ks 0.95 0.95 0.95
19+
Ns 1024
20+
illum 5
21+
22+
newmtl rightSphere
23+
Ka 0.01 0.01 0.01
24+
Kd 0.01 0.01 0.01
25+
Ks 0.30 0.30 0.30
26+
Tf 0.10 0.10 0.10
27+
Ns 1000
28+
Ni 2.5
29+
illum 7
30+
31+
newmtl floor
32+
Ns 10.0000
33+
Ni 1.5000
34+
illum 2
35+
Ka 0.7250 0.7100 0.6800
36+
Kd 0.7250 0.7100 0.6800
37+
Ks 0 0 0
38+
39+
newmtl ceiling
40+
Ns 10.0000
41+
Ni 1.5000
42+
illum 2
43+
Ka 0.7250 0.7100 0.6800
44+
Kd 0.7250 0.7100 0.6800
45+
Ks 0.0000 0.0000 0.0000
46+
47+
newmtl backWall
48+
Ns 10.0000
49+
Ni 1.5000
50+
illum 2
51+
Ka 0.7250 0.7100 0.6800
52+
Kd 0.7250 0.7100 0.6800
53+
Ks 0.0000 0.0000 0.0000
54+
Ke 0.0000 0.0000 0.0000
55+
56+
newmtl rightWall
57+
Ns 10.0000
58+
illum 2
59+
Ka 0.161 0.133 0.427 # Blue
60+
Kd 0.161 0.133 0.427
61+
Ks 0 0 0
62+
63+
newmtl leftWall
64+
Ns 10.0000
65+
illum 2
66+
Ka 0.6300 0.0650 0.0500
67+
Kd 0.6300 0.0650 0.0500
68+
Ks 0 0 0
69+
70+
newmtl light
71+
Ns 10.0000
72+
Ni 1.5000
73+
d 1.0000
74+
Tr 0.0000
75+
Tf 1.0000 1.0000 1.0000
76+
illum 2
77+
Ka 0.7800 0.7800 0.7800
78+
Kd 0.7800 0.7800 0.7800
79+
Ke 10 10 10
80+
Ks 0 0 0

0 commit comments

Comments
 (0)