Importing obj file with transparent material

Forums: Importing obj file with transparent material
A public forum for discussing and asking questions about the demo version of Octane Render.
Forum rules
For new users: this forum is moderated. Your first post will appear only after it has been reviewed by a moderator, so it will not show up immediately.
This is necessary to avoid this forum being flooded by spam.

Importing obj file with transparent material

Postby objo » Sun Dec 04, 2011 9:51 am

objo Sun Dec 04, 2011 9:51 am
I am making an open source exporter (.net/WPF) that creates obj files for import in Octane.
Diffuse materials and geometry works great, but I don't get Octane to import the specular components and opacity of my simple materials.
Here is an example I would expect to show two diffuse/specular/transparent planes:

test1.mtl
Code: Select all
newmtl PlaneMaterial
Kd 1.0 0.0 0.0
Ks 0.4 0.4 0.4
d 0.5
illum 2


test1.obj
Code: Select all
mtllib test1.mtl
o Planes
v 1 0 -1
v 1 0 1
v -1 0 1
v -1 0 -1
v 1 0.1 -1
v 1 0.1 1
v -1 0.1 1
v -1 0.1 -1
vn 0 1 0
usemtl PlaneMaterial
s off
f 1//1 4//1 3//1 2//1
f 5//1 8//1 7//1 6//1


Is something wrong here?
I use default OBJ mesh import preferences, both "Diffuse" and "Specular" material types are checked.
I have tried using both "Tr" and "d" in the mtl file.
objo
Licensed Customer
Licensed Customer
 
Posts: 3
Joined: Sun Oct 02, 2011 11:28 am
Location: Oslo, Norway

Re: Importing obj file with transparent material

Postby face » Sun Dec 04, 2011 11:18 am

face Sun Dec 04, 2011 11:18 am
Diffuse: Specular Decay = 0 or Specular Color = black
Specular: Index Of Refraction > 1 and Transparancy Color > black
Glossy: All other possible options

hope this helps...

face
Win10 Pro, Driver 378.78, Softimage 2015SP2 & Octane 3.05 RC1,
64GB Ram, i7-6950X, GTX1080TI 11GB
http://vimeo.com/user2509578
User avatar
face
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 3204
Joined: Sat Mar 06, 2010 2:10 pm
Location: Germany

Re: Importing obj file with transparent material

Postby t_3 » Sun Dec 04, 2011 11:47 am

t_3 Sun Dec 04, 2011 11:47 am
... here is a working example (glossy), including bump & opacity maps:

Plane.obj:
Code: Select all
mtllib Plane.mtl
o Plane
v 0 0 1
v 1 0 1
v 0 0 0
v 1 0 0
vt 0 0
vt 1 0
vt 0 1
vt 1 1
vn 0 1 0
vn 0 1 0
vn 0 1 0
vn 0 1 0
g Plane
usemtl Default
f 1/1/1 2/2/2 4/4/4 3/3/3

Plane.mtl:
Code: Select all
newmtl Default
Ns 1
Kd 1 0 0
Ks 0 0 1
Km 1
map_D /Maps/dummy.jpg
map_Bump /Maps/dummy.jpg

and another .mtl for specular:

Plane.mtl:
Code: Select all
newmtl Default
Ns 1
Ni 2
Kd 1 0 0
Ks 0 0 1

or in other words, you're missing the "Ni" - index of refraction - and opacity only works through an applied map (but i'm maybe wrong here)...
The obvious is that which is never seen until someone expresses it simply

1x i7 2600K @5.0 (Asrock Z77), 16GB, 2x Asus GTX Titan 6GB @1200/3100/6200
2x i7 2600K @4.5 (P8Z68 -V P), 12GB, 1x EVGA GTX 580 3GB @0900/2200/4400
User avatar
t_3
 
Posts: 2871
Joined: Tue Jul 05, 2011 5:37 pm

Re: Importing obj file with transparent material

Postby Tugpsx » Sun Dec 04, 2011 7:16 pm

Tugpsx Sun Dec 04, 2011 7:16 pm
nice find
Dell Win Vista 32 | NVIDIA Quadro NVS135M | Core2 Duo T7500 2.20GHz | 4GB
CyberPowerPC Win 7 64| NVIDIA GTX660Ti (3G) GTX480(1.5G) | 16GB
Tugpsx
Licensed Customer
Licensed Customer
 
Posts: 1145
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL

Re: Importing obj file with transparent material

Postby objo » Mon Dec 05, 2011 6:52 pm

objo Mon Dec 05, 2011 6:52 pm
Thanks for your replies!!
I have specular materials working now, but still have problems with opacity.

Specular materials: I see there is a difference when I specify Ni or not:
if I specify Ni, I get a specular material with Reflection (Ks) and Transmission (Kd) components.
if I do not specify Ni, I get a glossy material with Diffuse (Kd) and Specular (Ks) components.

Opacity: I also tried setting the dissolve map (map_D), but can't get this imported. There is also no effect of the dissolve parameter (d). The "Texture types|opacity (d)" is checked under preferences. Diffuse and bump maps are imported ok. Are there any other parameter I have to set?

The following is from the obj spec
map_d -options args filename

Specifies that a scalar texture file or scalar procedural texture file
is linked to the dissolve of the material. During rendering, the map_d
value is multiplied by the d value.

"filename" is the name of a scalar texture file (.mps), a scalar
procedural texture file (.cxs), or an image file.

The options for the map_d statement are listed below. These options
are described in detail in "Options for texture map statements" on page
5-18.

-blendu on | off
-blendv on | off
-clamp on | off
-imfchan r | g | b | m | l | z
-mm base gain
-o u v w
-s u v w
-t u v w
-texres value

and
d factor

Specifies the dissolve for the current material.

"factor" is the amount this material dissolves into the background. A
factor of 1.0 is fully opaque. This is the default when a new material
is created. A factor of 0.0 is fully dissolved (completely
transparent).

Unlike a real transparent material, the dissolve does not depend upon
material thickness nor does it have any spectral character. Dissolve
works on all illumination models.


t_3: Thanks for your examples! I don't get the dissolve map to import, does it work on your machine?

(I am using 1.0beta 2.46b demo)
objo
Licensed Customer
Licensed Customer
 
Posts: 3
Joined: Sun Oct 02, 2011 11:28 am
Location: Oslo, Norway

Re: Importing obj file with transparent material

Postby t_3 » Mon Dec 05, 2011 7:32 pm

t_3 Mon Dec 05, 2011 7:32 pm
the examples work here - with 2.55b; could, be that it really is different to 2.46. i remember, that around 2.49 the import was corrected, so that "map_d" and "map_D" would work, so maybe opacity import was not working at all (earlier).

the "d" is completely ignored, but i don't know why (haven't missed it that much though)...
The obvious is that which is never seen until someone expresses it simply

1x i7 2600K @5.0 (Asrock Z77), 16GB, 2x Asus GTX Titan 6GB @1200/3100/6200
2x i7 2600K @4.5 (P8Z68 -V P), 12GB, 1x EVGA GTX 580 3GB @0900/2200/4400
User avatar
t_3
 
Posts: 2871
Joined: Tue Jul 05, 2011 5:37 pm

Re: Importing obj file with transparent material

Postby objo » Tue Dec 06, 2011 6:55 pm

objo Tue Dec 06, 2011 6:55 pm
ok, that makes a good reason to upgrade to the full version :)
I hope support for the "d" value can be implemented soon!
objo
Licensed Customer
Licensed Customer
 
Posts: 3
Joined: Sun Oct 02, 2011 11:28 am
Location: Oslo, Norway

Re: Importing obj file with transparent material

Postby t_3 » Tue Dec 06, 2011 9:04 pm

t_3 Tue Dec 06, 2011 9:04 pm
objo wrote:ok, that makes a good reason to upgrade to the full version :)
I hope support for the "d" value can be implemented soon!

this seems to be the most uncommon reason ever to buy octane :lol:
but as you get pmc, sss & speed improvements as well, you won't regret it imo...
The obvious is that which is never seen until someone expresses it simply

1x i7 2600K @5.0 (Asrock Z77), 16GB, 2x Asus GTX Titan 6GB @1200/3100/6200
2x i7 2600K @4.5 (P8Z68 -V P), 12GB, 1x EVGA GTX 580 3GB @0900/2200/4400
User avatar
t_3
 
Posts: 2871
Joined: Tue Jul 05, 2011 5:37 pm

Return to Demo Version Questions & Discussion


Who is online

Users browsing this forum: No registered users and 32 guests

Sun Apr 28, 2024 6:09 am [ UTC ]