POV-Ray export questions


RE: POV-Ray export questions
#18
(2016-10-11, 19:55)Niklas Buchmann Wrote: You defined the textures in the model using texture{} directly inside each object{} statement. Instead, it should have a material{} statement at that level, like this:
Other material definitions include the interior{} statement for transparent objects, using a good interior makes all the difference in making transparent objects look good.

the reason for that was the texture_list property of mesh2, but I think I'm going to split it into texture and material defs so both can be used.

edit, made some changes to the generator it now renders this 'out of the box' (which I'm very happy with).
   

Colors are now generated like so:
Code:
#macro ldrawTexPlastic(r, g, b, a)
pigment {
 #if (a<1.0)
  srgbt <r,g,b,0.9>
 #else
  srgb <r,g,b>
 #end
}

normal {
 bumps 0.005
 scale 0.5
 turbulence 0
}

finish {
 emission rgb colorEmission
 diffuse 1
 brilliance 1
 conserve_energy

 phong 0.5
 phong_size 40
 metallic 0
 
 reflection {
  rgb <0.08, 0.08, 0.08>
  falloff 1
  exponent 1
  metallic 0
 }
}

#end

#macro ldrawTexRubber(r, g, b, a)
pigment {
 srgb <r,g,b>
}

normal {
 dents 0.01
 scale 0.25
 turbulence 0
}

finish {
 emission rgb colorEmission
 diffuse 1
 brilliance 0.1
 conserve_energy
}


#end

#macro ldrawTexChrome(r, g, b, a)
pigment {
 srgb <r,g,b>
}

normal {
 bumps 0.01
 scale 0.1
 turbulence 0
}

finish {
 emission rgb colorEmission*0.1
 brilliance 6
 diffuse 0.7
 metallic
 specular 0.80
 roughness 1/120
 reflection 0.8
}
#end

#declare ldTex0=texture {
ldrawTexPlastic(0.019608,0.07451,0.113725,1)
}

#declare ldMat0=material {
texture { ldTex0 }
}

#declare ldTex1=texture {
ldrawTexPlastic(0,0.333333,0.74902,1)
}

#declare ldMat1=material {
texture { ldTex1 }
}

#declare ldTex4=texture {
ldrawTexPlastic(0.788235,0.101961,0.035294,1)
}

#declare ldMat4=material {
texture { ldTex4 }
}

#declare ldTex7=texture {
ldrawTexPlastic(0.607843,0.631373,0.615686,1)
}

#declare ldMat7=material {
texture { ldTex7 }
}

#declare ldTex8=texture {
ldrawTexPlastic(0.427451,0.431373,0.360784,1)
}

#declare ldMat8=material {
texture { ldTex8 }
}

#declare ldTex9=texture {
ldrawTexPlastic(0.705882,0.823529,0.890196,1)
}

#declare ldMat9=material {
texture { ldTex9 }
}

#declare ldTex14=texture {
ldrawTexPlastic(0.94902,0.803922,0.215686,1)
}

#declare ldMat14=material {
texture { ldTex14 }
}

#declare ldTex15=texture {
ldrawTexPlastic(1,1,1,1)
}

#declare ldMat15=material {
texture { ldTex15 }
}

#declare ldTex36=texture {
ldrawTexPlastic(0.788235,0.101961,0.035294,0.501961)
}

#declare ldMat36=material {
texture { ldTex36 }
}

#declare ldTex43=texture {
ldrawTexPlastic(0.682353,0.913725,0.937255,0.501961)
}

#declare ldMat43=material {
texture { ldTex43 }
}

#declare ldTex46=texture {
ldrawTexPlastic(0.960784,0.803922,0.184314,0.501961)
}

#declare ldMat46=material {
texture { ldTex46 }
}

#declare ldTex47=texture {
ldrawTexPlastic(0.988235,0.988235,0.988235,0.501961)
}

#declare ldMat47=material {
texture { ldTex47 }
}

#declare ldTex256=texture {
ldrawTexRubber(0.129412,0.129412,0.129412,1)
}

#declare ldMat256=material {
texture { ldTex256 }
}

#declare ldTex383=texture {
ldrawTexChrome(0.878431,0.878431,0.878431,1)
}

#declare ldMat383=material {
texture { ldTex383 }
}

The contents of ldrawTex* macros are read from a config file so you could always tweak them, I'll probably also going to surround most stuff with 'if defined' conditions.

Transparent part improvements (using material) still pending though.
Reply
« Next Oldest | Next Newest »



Messages In This Thread
POV-Ray export questions - by Roland Melkert - 2016-08-13, 18:02
RE: POV-Ray export questions - by Damien Roux - 2016-08-13, 21:08
RE: POV-Ray export questions - by Roland Melkert - 2016-10-11, 20:54

Forum Jump:


Users browsing this thread: 5 Guest(s)