Comments (8)
No worries. Merged just now. Thanks!
from pbrt-v4.
Hi @mmp I can review this issue. I am using a derived version of this code for my own project.
Cheers..
from pbrt-v4.
Ths first fix is simple change from 'point2 st' to 'point2 uv'..
diff --git "a/src/pbrt/cmd/obj2pbrt.cpp" "b/src/pbrt/cmd/obj2pbrt.cpp"
index 39cd283..f508626 100644
--- "a/src/pbrt/cmd/obj2pbrt.cpp"
+++ "b/src/pbrt/cmd/obj2pbrt.cpp"
@@ -1591,7 +1591,7 @@ int main(int argc, char *argv[]) {
fprintf(f, "]\n");
}
if (!st.empty()) {
- fprintf(f, " \"point2 st\" [ \n");
+ fprintf(f, " \"point2 uv\" [ \n");
for (Point2f tex : st)
fprintf(f, "\t%.10g %.10g\n", tex.x, tex.y);
fprintf(f, "]\n");
from pbrt-v4.
The other fix are related with the default material use in obj2pbrt ( uber) that are is deprecated.. @mmp what do you think is the best candidate to use now?
Edit: I think CoatedDiffuseMaterial
is the best.. but it's just my opinion.
Cheers..
from pbrt-v4.
Generally speaking I agree that coated diffuse covers a lot of it. The full OBJ material model has all sorts of non-physical functionality (https://en.wikipedia.org/wiki/Wavefront_.obj_file#Material_template_library), which makes it tricky.
e.g. illum model 3 definitely sounds like coated diffuse. 4 is probably a dielectric interface with 0 roughness, 5 is probably coated diffuse again. 6,7 again a dielectric interface. I guess it boils down to either coated diffuse if it's reflective and a dielectric interface if it's transmissive. pbrt's dielectric interface BxDF no longer allows specifying a color, so that stuff will be lost..
from pbrt-v4.
@mmp I'm sorry.. I have some issues to isolate only the fix code for create pull request. Meanwhile, better drop here the .diff
diff --git "a/src/pbrt/cmd/obj2pbrt.cpp" "b/src/pbrt/cmd/obj2pbrt.cpp"
index f508626..db1a6ef 100644
--- "a/src/pbrt/cmd/obj2pbrt.cpp"
+++ "b/src/pbrt/cmd/obj2pbrt.cpp"
@@ -1366,7 +1366,7 @@ int main(int argc, char *argv[]) {
if (mtl.diffuse[0] != 0 || mtl.diffuse[1] != 0 || mtl.diffuse[2] != 0) {
fprintf(f,
"Texture \"%s-kd-img\" \"spectrum\" \"imagemap\" "
- "\"string imagefile\" [\"%s\"]\n",
+ "\"string filename\" [\"%s\"]\n",
mtl.name.c_str(), mtl.diffuse_texname.c_str());
float scale = (mtl.diffuse[0] + mtl.diffuse[1] + mtl.diffuse[2]) / 3;
if (mtl.diffuse[0] != mtl.diffuse[1] || mtl.diffuse[1] != mtl.diffuse[2])
@@ -1382,7 +1382,7 @@ int main(int argc, char *argv[]) {
} else {
fprintf(f,
"Texture \"%s-kd\" \"spectrum\" \"imagemap\" "
- "\"string imagefile\" [\"%s\"]\n",
+ "\"string filename\" [\"%s\"]\n",
mtl.name.c_str(), mtl.diffuse_texname.c_str());
}
}
@@ -1392,7 +1392,7 @@ int main(int argc, char *argv[]) {
if (mtl.specular[0] != 0 || mtl.specular[1] != 0 || mtl.specular[2] != 0) {
fprintf(f,
"Texture \"%s-ks-img\" \"spectrum\" \"imagemap\" "
- "\"string imagefile\" [\"%s\"]\n",
+ "\"string filename\" [\"%s\"]\n",
mtl.name.c_str(), mtl.specular_texname.c_str());
float scale = (mtl.specular[0] + mtl.specular[1] + mtl.specular[2]) / 3;
if (mtl.specular[0] != mtl.specular[1] ||
@@ -1409,7 +1409,7 @@ int main(int argc, char *argv[]) {
} else {
fprintf(f,
"Texture \"%s-ks\" \"spectrum\" \"imagemap\" "
- "\"string imagefile\" [\"%s\"]\n",
+ "\"string filename\" [\"%s\"]\n",
mtl.name.c_str(), mtl.specular_texname.c_str());
}
}
@@ -1417,12 +1417,12 @@ int main(int argc, char *argv[]) {
if (!mtl.bump_texname.empty()) {
fprintf(f,
"Texture \"%s-bump\" \"float\" \"imagemap\" "
- "\"string imagefile\" [\"%s\"]\n",
+ "\"string filename\" [\"%s\"]\n",
mtl.name.c_str(), mtl.bump_texname.c_str());
}
float roughness = (mtl.shininess == 0) ? 0. : (1.f / mtl.shininess);
- fprintf(f, R"(MakeNamedMaterial "%s" "string type" "uber" )", mtl.name.c_str());
+ fprintf(f, R"(MakeNamedMaterial "%s" "string type" "coateddiffuse" )", mtl.name.c_str());
if (hasDiffuseTex)
fprintf(f, R"("texture reflectance" "%s-kd" )", mtl.name.c_str());
from pbrt-v4.
Nice.. I hope to find a bit time this weekend to continue fixing some more things.
from pbrt-v4.
This is now moot, given cd47b40.
from pbrt-v4.
Related Issues (20)
- Possible wrong use of non-symmetric BRDF with BDPT
- Random crash on CPU rendering HOT 3
- mmp, FYI, --cropwindow
- Function Film.ToOutputRGB seems to output negative values in the photon mapper.
- Results get overly exposure when rendering with AOIntegrator and RGBFilm with ISO larger than 100
- Cannot use pbrt-v4 HOT 4
- GPU Build issue HOT 6
- Exhaustive light sampler + area light + GPU render = fatal error HOT 1
- pbrt-v4 as an external lib fails to create pbrt_soa.h HOT 2
- Cannot use GPU version on windows HOT 2
- Units for scene files HOT 6
- TeX comments in IDE HOT 1
- Potential incorrect mutex usage in ptex cache construction HOT 1
- Equation 14.24 seems missing from the online version of the pbrt-v4 book HOT 1
- Request: support light source definition via IES data HOT 1
- using --pixelstats in conjunction with --outfile do not work as expected
- Specify Volume with Transform and Camera Inside Volume in a Scene File
- PBRT hangs while rendering certain scenes with subsurface materials from a certain sample rate and higher
- Spectral range in SpectralFilm is overruled by constants in spectrum.h
- [Ubuntu] Unable to build TEV; uintptr_t not declared in scope.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pbrt-v4.