mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-19 11:04:39 +00:00
added "render_template" folder and an example template
This commit is contained in:
parent
4ac1fa01d7
commit
4167fcb2d8
BIN
src/meshlab/render_template/default/0001.tif
Normal file
BIN
src/meshlab/render_template/default/0001.tif
Normal file
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
##RenderMan RIB-Structure 1.1 Entity
|
||||
version 3.03
|
||||
Format 800 600 1
|
||||
ShadingRate 1.0
|
||||
PixelSamples 4 4
|
||||
Imager "MOSAICbackground"
|
||||
"uniform color bgcolor" [ 0.0565629005432 0.220815420151 0.40000000596 ]
|
||||
Shutter 0.0 1.0
|
||||
Clipping 0.10000000149 100.0
|
||||
Projection "perspective" "fov" [ 37.8492888321 ]
|
||||
ScreenWindow -1.33333333333 1.33333333333 -1.0 1.0
|
||||
##CameraOrientation [ 7.48113155365 -6.50763988495 5.34366512299 ] [ 6.82626968622 -5.89697426558 4.89841976762 ]
|
||||
Transform [ 0.685880541801 -0.317370116711 -0.654861867428 0.0
|
||||
0.727633714676 0.312468618155 0.610665559769 0.0
|
||||
-0.0108167640865 0.89534330368 -0.445245355368 0.0
|
||||
-0.338183134794 -0.376693725586 11.2523422241 1.0 ]
|
||||
@ -0,0 +1,33 @@
|
||||
##RenderMan RIB-Structure 1.1 Entity
|
||||
version 3.03
|
||||
Declare "Cs" "facevarying color"
|
||||
Declare "st" "facevarying float[2]"
|
||||
Declare "N" "facevarying normal"
|
||||
PointsPolygons
|
||||
[
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
]
|
||||
[
|
||||
0 1 2 3
|
||||
4 7 6 5
|
||||
0 4 5 1
|
||||
1 5 6 2
|
||||
2 6 7 3
|
||||
4 0 3 7
|
||||
]
|
||||
"P"
|
||||
[
|
||||
1.9860022068 1.98704361916 -1.0
|
||||
1.9860022068 -1.99139595032 -1.0
|
||||
-1.99580550194 -1.99139595032 -1.0
|
||||
-1.9958050251 1.98704409599 -1.0
|
||||
1.24391019344 1.24390900135 0.149156153202
|
||||
1.24390876293 -1.24391043186 0.149156153202
|
||||
-1.24390995502 -1.24390912056 0.149156153202
|
||||
-1.24390947819 1.2439095974 0.149156153202
|
||||
]
|
||||
@ -0,0 +1,33 @@
|
||||
##RenderMan RIB-Structure 1.1 Entity
|
||||
version 3.03
|
||||
Declare "Cs" "facevarying color"
|
||||
Declare "st" "facevarying float[2]"
|
||||
Declare "N" "facevarying normal"
|
||||
PointsPolygons
|
||||
[
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
4
|
||||
]
|
||||
[
|
||||
0 1 2 3
|
||||
4 7 6 5
|
||||
0 4 5 1
|
||||
1 5 6 2
|
||||
2 6 7 3
|
||||
4 0 3 7
|
||||
]
|
||||
"P"
|
||||
[
|
||||
1.0 0.999999940395 -1.0
|
||||
1.0 -1.0 -1.0
|
||||
-1.00000011921 -0.999999821186 -1.0
|
||||
-0.999999642372 1.00000035763 -1.0
|
||||
1.00000047684 0.999999463558 1.0
|
||||
0.999999344349 -1.00000059605 1.0
|
||||
-1.00000035763 -0.999999642372 1.0
|
||||
-0.999999940395 1.0 1.0
|
||||
]
|
||||
@ -0,0 +1,165 @@
|
||||
##RenderMan RIB-Structure 1.1 Entity
|
||||
version 3.03
|
||||
AttributeBegin
|
||||
Attribute "identifier" "string name" [ "Lamp" ]
|
||||
Attribute "user" "integer id" [ 427473682 ]
|
||||
Transform [ 0.290864557028 -0.955171108246 0.0551891066134 0.0
|
||||
0.771100819111 0.199883252382 -0.604524731636 0.0
|
||||
-0.566393136978 -0.21839119494 -0.794672191143 0.0
|
||||
4.07624530792 1.00545394421 5.90386199951 1.0 ]
|
||||
MotionBegin [ 0.0 0.5 1.0 ]
|
||||
LightSource "MOSAIClight" 1
|
||||
"uniform float CausticAlpha" [ 1.0 ]
|
||||
"uniform color CausticColor" [ 1 1 1 ]
|
||||
"uniform float CausticSamples" [ 64 ]
|
||||
"uniform float CausticBlur" [ 0.05 ]
|
||||
"uniform float CausticThreshold" [ 0.8 ]
|
||||
"uniform float CausticNoise" [ 2.5 ]
|
||||
"uniform float noisefreq" [ 0 ]
|
||||
"uniform float noisepow" [ 1 ]
|
||||
"uniform float SSSWidth" [ 0 ]
|
||||
"varying color SSSDepth" [ 0 0 0 ]
|
||||
"uniform string projectionmap" [ "" ]
|
||||
"uniform string environmentmap" [ "" ]
|
||||
"uniform float Bias" [ 0.1 ]
|
||||
"varying float Blur" [ 0.012 ]
|
||||
"varying float RayBlur" [ 0.06 ]
|
||||
"uniform float Samples" [ 9.0 ]
|
||||
"uniform float RaySamples" [ 1.0 ]
|
||||
"varying float [4] ProjOfSz" [ 0 0 1 1 ]
|
||||
"uniform float __foglight" [ 1 ]
|
||||
"uniform float __nonspecular" [ 0.0 ]
|
||||
"uniform float __nondiffuse" [ 0.0 ]
|
||||
"uniform float Falloff" [ 1.0 ]
|
||||
"uniform float isSphere" [ 0.0 ]
|
||||
"uniform float isRaytrace" [ 1.0 ]
|
||||
"uniform float Quad3" [ 0 ]
|
||||
"uniform float Quad2" [ 1.0 ]
|
||||
"uniform float Quad1" [ 0.0 ]
|
||||
"uniform float SpotBl" [ 0.0300000011921 ]
|
||||
"uniform float SpotSi" [ 0.654498469496 ]
|
||||
"uniform float Dist" [ 29.9999828339 ]
|
||||
"uniform float Energy" [ 1.0 ]
|
||||
"uniform float LightType" [ 0.0 ]
|
||||
"uniform point up" [ 0 1 0 ]
|
||||
"uniform point to" [ 0.0 0.0 1.0 ]
|
||||
"uniform point from" [ 0.0 0.0 0.0 ]
|
||||
"uniform color LightColor" [ 1.0 1.0 1.0 ]
|
||||
"uniform string shadowname_nz" [ "" ]
|
||||
"uniform string shadowname_pz" [ "" ]
|
||||
"uniform string shadowname_ny" [ "" ]
|
||||
"uniform string shadowname_py" [ "" ]
|
||||
"uniform string shadowname_nx" [ "" ]
|
||||
"uniform string shadowname_px" [ "" ]
|
||||
"uniform string shadowname" [ "" ]
|
||||
"uniform string causticname_nz" [ "" ]
|
||||
"uniform string causticname_pz" [ "" ]
|
||||
"uniform string causticname_ny" [ "" ]
|
||||
"uniform string causticname_py" [ "" ]
|
||||
"uniform string causticname_nx" [ "" ]
|
||||
"uniform string causticname_px" [ "" ]
|
||||
"uniform string causticname" [ "" ]
|
||||
LightSource "MOSAIClight" 1
|
||||
"uniform float CausticAlpha" [ 1.0 ]
|
||||
"uniform color CausticColor" [ 1 1 1 ]
|
||||
"uniform float CausticSamples" [ 64 ]
|
||||
"uniform float CausticBlur" [ 0.05 ]
|
||||
"uniform float CausticThreshold" [ 0.8 ]
|
||||
"uniform float CausticNoise" [ 2.5 ]
|
||||
"uniform float noisefreq" [ 0 ]
|
||||
"uniform float noisepow" [ 1 ]
|
||||
"uniform float SSSWidth" [ 0 ]
|
||||
"varying color SSSDepth" [ 0 0 0 ]
|
||||
"uniform string projectionmap" [ "" ]
|
||||
"uniform string environmentmap" [ "" ]
|
||||
"uniform float Bias" [ 0.1 ]
|
||||
"varying float Blur" [ 0.012 ]
|
||||
"varying float RayBlur" [ 0.06 ]
|
||||
"uniform float Samples" [ 9.0 ]
|
||||
"uniform float RaySamples" [ 1.0 ]
|
||||
"varying float [4] ProjOfSz" [ 0 0 1 1 ]
|
||||
"uniform float __foglight" [ 1 ]
|
||||
"uniform float __nonspecular" [ 0.0 ]
|
||||
"uniform float __nondiffuse" [ 0.0 ]
|
||||
"uniform float Falloff" [ 1.0 ]
|
||||
"uniform float isSphere" [ 0.0 ]
|
||||
"uniform float isRaytrace" [ 1.0 ]
|
||||
"uniform float Quad3" [ 0 ]
|
||||
"uniform float Quad2" [ 1.0 ]
|
||||
"uniform float Quad1" [ 0.0 ]
|
||||
"uniform float SpotBl" [ 0.0300000011921 ]
|
||||
"uniform float SpotSi" [ 0.654498469496 ]
|
||||
"uniform float Dist" [ 29.9999828339 ]
|
||||
"uniform float Energy" [ 1.0 ]
|
||||
"uniform float LightType" [ 0.0 ]
|
||||
"uniform point up" [ 0 1 0 ]
|
||||
"uniform point to" [ 0.0 0.0 1.0 ]
|
||||
"uniform point from" [ 0.0 0.0 0.0 ]
|
||||
"uniform color LightColor" [ 1.0 1.0 1.0 ]
|
||||
"uniform string shadowname_nz" [ "" ]
|
||||
"uniform string shadowname_pz" [ "" ]
|
||||
"uniform string shadowname_ny" [ "" ]
|
||||
"uniform string shadowname_py" [ "" ]
|
||||
"uniform string shadowname_nx" [ "" ]
|
||||
"uniform string shadowname_px" [ "" ]
|
||||
"uniform string shadowname" [ "" ]
|
||||
"uniform string causticname_nz" [ "" ]
|
||||
"uniform string causticname_pz" [ "" ]
|
||||
"uniform string causticname_ny" [ "" ]
|
||||
"uniform string causticname_py" [ "" ]
|
||||
"uniform string causticname_nx" [ "" ]
|
||||
"uniform string causticname_px" [ "" ]
|
||||
"uniform string causticname" [ "" ]
|
||||
LightSource "MOSAIClight" 1
|
||||
"uniform float CausticAlpha" [ 1.0 ]
|
||||
"uniform color CausticColor" [ 1 1 1 ]
|
||||
"uniform float CausticSamples" [ 64 ]
|
||||
"uniform float CausticBlur" [ 0.05 ]
|
||||
"uniform float CausticThreshold" [ 0.8 ]
|
||||
"uniform float CausticNoise" [ 2.5 ]
|
||||
"uniform float noisefreq" [ 0 ]
|
||||
"uniform float noisepow" [ 1 ]
|
||||
"uniform float SSSWidth" [ 0 ]
|
||||
"varying color SSSDepth" [ 0 0 0 ]
|
||||
"uniform string projectionmap" [ "" ]
|
||||
"uniform string environmentmap" [ "" ]
|
||||
"uniform float Bias" [ 0.1 ]
|
||||
"varying float Blur" [ 0.012 ]
|
||||
"varying float RayBlur" [ 0.06 ]
|
||||
"uniform float Samples" [ 9.0 ]
|
||||
"uniform float RaySamples" [ 1.0 ]
|
||||
"varying float [4] ProjOfSz" [ 0 0 1 1 ]
|
||||
"uniform float __foglight" [ 1 ]
|
||||
"uniform float __nonspecular" [ 0.0 ]
|
||||
"uniform float __nondiffuse" [ 0.0 ]
|
||||
"uniform float Falloff" [ 1.0 ]
|
||||
"uniform float isSphere" [ 0.0 ]
|
||||
"uniform float isRaytrace" [ 1.0 ]
|
||||
"uniform float Quad3" [ 0 ]
|
||||
"uniform float Quad2" [ 1.0 ]
|
||||
"uniform float Quad1" [ 0.0 ]
|
||||
"uniform float SpotBl" [ 0.0300000011921 ]
|
||||
"uniform float SpotSi" [ 0.654498469496 ]
|
||||
"uniform float Dist" [ 29.9999828339 ]
|
||||
"uniform float Energy" [ 1.0 ]
|
||||
"uniform float LightType" [ 0.0 ]
|
||||
"uniform point up" [ 0 1 0 ]
|
||||
"uniform point to" [ 0.0 0.0 1.0 ]
|
||||
"uniform point from" [ 0.0 0.0 0.0 ]
|
||||
"uniform color LightColor" [ 1.0 1.0 1.0 ]
|
||||
"uniform string shadowname_nz" [ "" ]
|
||||
"uniform string shadowname_pz" [ "" ]
|
||||
"uniform string shadowname_ny" [ "" ]
|
||||
"uniform string shadowname_py" [ "" ]
|
||||
"uniform string shadowname_nx" [ "" ]
|
||||
"uniform string shadowname_px" [ "" ]
|
||||
"uniform string shadowname" [ "" ]
|
||||
"uniform string causticname_nz" [ "" ]
|
||||
"uniform string causticname_pz" [ "" ]
|
||||
"uniform string causticname_ny" [ "" ]
|
||||
"uniform string causticname_py" [ "" ]
|
||||
"uniform string causticname_nx" [ "" ]
|
||||
"uniform string causticname_px" [ "" ]
|
||||
"uniform string causticname" [ "" ]
|
||||
MotionEnd
|
||||
AttributeEnd
|
||||
@ -0,0 +1,80 @@
|
||||
##RenderMan RIB-Structure 1.1 Entity
|
||||
version 3.03
|
||||
Surface "MOSAICsurface"
|
||||
"uniform float EnvBlur" [ 0 ]
|
||||
"uniform float EnvSamples" [ 8 ]
|
||||
"uniform float OccBias" [ 0.3 ]
|
||||
"uniform float OccMaxdist" [ 1e38 ]
|
||||
"uniform float OccSamples" [ 8 ]
|
||||
"uniform float OccEnergy" [ 1 ]
|
||||
"uniform float OccMapBlur" [ 0.01 ]
|
||||
"uniform float SSSTexBlur" [ 0.0 ]
|
||||
"varying float isSSS" [ 0.0 ]
|
||||
"varying float SSSBlur" [ 0.129999995232 ]
|
||||
"varying float SSSBias" [ 0.0500000007451 ]
|
||||
"varying float SSSSamples" [ 64 ]
|
||||
"uniform float SSSFact" [ 0.10000000149 ]
|
||||
"uniform float SSSFront" [ 0.2 ]
|
||||
"uniform float SSSBack" [ 1.0 ]
|
||||
"uniform float SSSR" [ 1.0 ]
|
||||
"uniform float SSSG" [ 1.0 ]
|
||||
"uniform float SSSB" [ 1.0 ]
|
||||
"varying float ShadowAlpha" [ 1.0 ]
|
||||
"uniform float isOcclusion" [ 0.0 ]
|
||||
"uniform float isShadeless" [ 0.0 ]
|
||||
"uniform float isRayTransp" [ 0.0 ]
|
||||
"uniform float isRayMirror" [ 0.0 ]
|
||||
"uniform float TranspFresnel" [ 0.0 ]
|
||||
"uniform float MirFresnel" [ 0.0 ]
|
||||
"uniform float IOR" [ 1.0 ]
|
||||
"uniform float ColMix" [ 0.0 ]
|
||||
"uniform float CmirMix" [ 0.0 ]
|
||||
"uniform float CspMix" [ 0.0 ]
|
||||
"uniform float TransLuMix" [ 0.0 ]
|
||||
"uniform float SSSColMix" [ 1.0 ]
|
||||
"uniform float Emit" [ 0.0 ]
|
||||
"uniform float Tralu" [ 0.0 ]
|
||||
"uniform float Alpha" [ 1.0 ]
|
||||
"uniform float Hard" [ 12.5 ]
|
||||
"uniform float RayMir" [ 0.0 ]
|
||||
"uniform float Spec" [ 0.5 ]
|
||||
"uniform float Ref" [ 0.800000011921 ]
|
||||
"uniform float Amb" [ 0.5 ]
|
||||
"uniform color AmbCol" [ 0.0 0.0 0.0 ]
|
||||
"uniform color OccCol" [ 0.0565629005432 0.220815420151 0.40000000596 ]
|
||||
"uniform color MirCol" [ 1.0 1.0 1.0 ]
|
||||
"uniform color SpecCol" [ 1.0 1.0 1.0 ]
|
||||
"uniform color SSSCol" [ 0.800000011921 0.800000011921 0.800000011921 ]
|
||||
"uniform string EmitMap" [ "" ]
|
||||
"uniform string AmbMap" [ "" ]
|
||||
"uniform string HardMap" [ "" ]
|
||||
"uniform string SpecMap" [ "" ]
|
||||
"uniform string RefMap" [ "" ]
|
||||
"uniform string CmirMap" [ "" ]
|
||||
"uniform string RayMirMap" [ "" ]
|
||||
"uniform string CspMap" [ "" ]
|
||||
"uniform string AlphaMap" [ "" ]
|
||||
"uniform string ColMap" [ "" ]
|
||||
"uniform string TransLuMap" [ "" ]
|
||||
"uniform string EnvMap" [ "" ]
|
||||
"uniform string IBLMap" [ "" ]
|
||||
"uniform string OccMap" [ "" ]
|
||||
"varying float [4] EmitOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] AmbOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] HardOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] SpecOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] RefOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] CmirOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] RayMirOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] CspOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] AlphaOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] ColOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] TransLuOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
Displacement "MOSAICdisplace"
|
||||
"uniform float Nor" [ 0.0 ]
|
||||
"uniform float Disp" [ 0.0 ]
|
||||
"uniform float Mid" [ 0.5 ]
|
||||
"uniform string NorMap" [ "" ]
|
||||
"uniform string DispMap" [ "" ]
|
||||
"varying float [4] NorOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
"varying float [4] DispOfSz" [ 0.0 0.0 1.0 1.0 ]
|
||||
@ -0,0 +1,24 @@
|
||||
##RenderMan RIB-Structure 1.1 Entity
|
||||
version 3.03
|
||||
AttributeBegin
|
||||
Attribute "identifier" "string name" [ "Cube" ]
|
||||
Attribute "user" "integer id" [ 1507813027 ]
|
||||
Transform [ 1.0 0.0 0.0 0.0
|
||||
0.0 1.0 0.0 0.0
|
||||
0.0 0.0 1.0 0.0
|
||||
0.0 0.0 0.0 1.0 ]
|
||||
Bound -1.99580550194 1.9860022068 -1.99139595032 1.98704409599 -1.0 0.149156153202
|
||||
ShadingInterpolation "smooth"
|
||||
Attribute "displacementbound" "float sphere" [ 0.1 ] "string coordinatesystem" [ "shader" ]
|
||||
AttributeBegin
|
||||
Attribute "identifier" "string name" [ "MB0Material" ]
|
||||
Attribute "user" "integer id" [ 250783171 ]
|
||||
##Include Archives/Materials/F1MB0Material.rib
|
||||
ReadArchive "F1MB0Material.rib"
|
||||
Color [ 0.800000011921 0.800000011921 0.800000011921 ]
|
||||
Opacity [ 1.0 1.0 1.0 ]
|
||||
Sides 2
|
||||
##Include Archives/Geometry/F1MRXM0Cube.rib
|
||||
ReadArchive "F1MRXM0Cube.rib"
|
||||
AttributeEnd
|
||||
AttributeEnd
|
||||
@ -0,0 +1,22 @@
|
||||
##RenderMan RIB-Structure 1.1 Entity
|
||||
version 3.03
|
||||
AttributeBegin
|
||||
Attribute "identifier" "string name" [ "dummy" ]
|
||||
Attribute "user" "integer id" [ 482804705 ]
|
||||
Transform [ 0.5 0.0 0.0 0.0
|
||||
0.0 0.5 0.0 0.0
|
||||
0.0 0.0 0.5 0.0
|
||||
0.0637825727463 -0.0225677788258 0.652353346348 1.0 ]
|
||||
Bound -1.00000035763 1.00000047684 -1.00000071526 1.00000035763 -1.0 0.999999880791
|
||||
ShadingInterpolation "smooth"
|
||||
Attribute "displacementbound" "float sphere" [ 0.10000000149 ] "string coordinatesystem" [ "shader" ]
|
||||
AttributeBegin
|
||||
Attribute "identifier" "string name" [ "Default Surface" ]
|
||||
Attribute "user" "integer id" [ 2081447881 ]
|
||||
Color [ 0.8 0.8 0.8 ]
|
||||
Surface "plastic" "float Kd" [ 0.8 ] "float Ks" [ 0.5 ] "float roughness" [ 0.25 ]
|
||||
Sides 2
|
||||
##Include Archives/Geometry/F1MRXM0Cube2.rib
|
||||
ReadArchive "F1MRXM0Cube2.rib"
|
||||
AttributeEnd
|
||||
AttributeEnd
|
||||
@ -0,0 +1,26 @@
|
||||
##RenderMan RIB-Structure 1.1 Entity
|
||||
version 3.03
|
||||
FrameBegin 1
|
||||
Display "0001.tif" "framebuffer" "rgb"
|
||||
Display "+0001.tif" "file" "rgba"
|
||||
##Include Archives/Cameras/F1CS0B0persp00Camera.rib
|
||||
ReadArchive "F1CS0B0persp00Camera.rib"
|
||||
WorldBegin
|
||||
Atmosphere "MOSAICfog"
|
||||
"uniform float isMist" [ 0.0 ]
|
||||
"uniform float Misi" [ 0.0 ]
|
||||
"uniform float Hi" [ 0.0 ]
|
||||
"uniform float Di" [ 0.0 ]
|
||||
"uniform float Sta" [ 0.0 ]
|
||||
"uniform float MistType" [ 0.0 ]
|
||||
"uniform color MistCol" [ 0.0565629005432 0.220815420151 0.40000000596 ]
|
||||
##Include Archives/Lights/F1LB0Lamp.rib
|
||||
ReadArchive "F1LB0Lamp.rib"
|
||||
##Scene light illuminates
|
||||
Illuminate 1 1
|
||||
##Include Archives/Objects/F1OB0S0Cube.rib
|
||||
ReadArchive "F1OB0S0Cube.rib"
|
||||
##Include Archives/Objects/F1OB0Sdummy.rib
|
||||
ReadArchive "F1OB0Sdummy.rib"
|
||||
WorldEnd
|
||||
FrameEnd
|
||||
@ -0,0 +1,10 @@
|
||||
/* MOSAIC default image shader for Blender integration */
|
||||
imager
|
||||
MOSAICbackground(
|
||||
color bgcolor = color(1, 1, 1))
|
||||
{
|
||||
Ci += (1 - alpha) * bgcolor;
|
||||
Oi = 1;
|
||||
alpha = 1;
|
||||
}
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
imager
|
||||
AQSIS_V 1.4.2
|
||||
|
||||
|
||||
segment Data
|
||||
|
||||
USES 8781824
|
||||
|
||||
param uniform color bgcolor
|
||||
|
||||
|
||||
segment Init
|
||||
pushif 1
|
||||
pushif 1
|
||||
pushif 1
|
||||
settc
|
||||
pop bgcolor
|
||||
|
||||
|
||||
segment Code
|
||||
pushv bgcolor
|
||||
pushv alpha
|
||||
pushif 1
|
||||
subff
|
||||
mulfc
|
||||
pushv Ci
|
||||
addcc
|
||||
pop Ci
|
||||
pushif 1
|
||||
setfc
|
||||
pop Oi
|
||||
pushif 1
|
||||
pop alpha
|
||||
@ -0,0 +1,44 @@
|
||||
/* MOSAIC default displacement shader for Blender integration */
|
||||
|
||||
//Adjust texture st with xy offset and size
|
||||
void stAdjust(output float sAdj,tAdj;float s,t,texOfSz[4])
|
||||
{
|
||||
sAdj = (s*texOfSz[2]-(texOfSz[2]-1)/2)+texOfSz[0];
|
||||
tAdj = (t*texOfSz[3]-(texOfSz[3]-1)/2)-texOfSz[1];
|
||||
}
|
||||
|
||||
displacement
|
||||
MOSAICdisplace(
|
||||
float Disp=1; //Standard Blender material controls
|
||||
float Nor=1;
|
||||
float Mid=0.5;
|
||||
string DispMap=""; //Standard Blender texture channels
|
||||
string NorMap="";
|
||||
varying float DispOfSz[4]={0,0,1,1}; //Texture mapping arrays as offset x/y scale x/y
|
||||
varying float NorOfSz[4]={0,0,1,1};)
|
||||
{
|
||||
float sAdj,tAdj;
|
||||
normal Un = N;
|
||||
if (DispMap != "") //Are we using a displacement texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,DispOfSz);
|
||||
float amp = Disp*(float texture(DispMap,sAdj,tAdj)-Mid);
|
||||
P += amp*normalize(N);
|
||||
Un = calculatenormal(P);
|
||||
}
|
||||
if (NorMap != "") //Are we using a normal texture map?
|
||||
{
|
||||
normal Nref = normalize(Un);
|
||||
vector dPds = normalize(Deriv(P,s));
|
||||
vector dPdt = normalize(Deriv(P,t));
|
||||
stAdjust(sAdj,tAdj,s,t,NorOfSz);
|
||||
color Ncolor = color texture(NorMap,sAdj,tAdj);
|
||||
vector Nvector = (vector(Ncolor)*2)-vector(1.0,1.0,1.0);
|
||||
vector Ntransformed = vector(comp(Nvector,0)*comp(dPds,0)+comp(Nvector,1)*comp(dPdt,0)+comp(Nvector,2)*comp(Nref,0),
|
||||
comp(Nvector,0)*comp(dPds,1)+comp(Nvector,1)*comp(dPdt,1)+comp(Nvector,2)*comp(Nref,1),
|
||||
comp(Nvector,0)*comp(dPds,2)+comp(Nvector,1)*comp(dPdt,2)+comp(Nvector,2)*comp(Nref,2));
|
||||
N = mix(Un,normal normalize(Ntransformed),Nor/2);
|
||||
}
|
||||
else N = Un;
|
||||
}
|
||||
|
||||
301
src/meshlab/render_template/default/Shaders/MOSAICdisplace.slx
Normal file
301
src/meshlab/render_template/default/Shaders/MOSAICdisplace.slx
Normal file
@ -0,0 +1,301 @@
|
||||
displacement
|
||||
AQSIS_V 1.4.2
|
||||
|
||||
|
||||
segment Data
|
||||
|
||||
USES 51456
|
||||
|
||||
param uniform float Disp
|
||||
param uniform float Nor
|
||||
param uniform float Mid
|
||||
param uniform string DispMap
|
||||
param uniform string NorMap
|
||||
param varying float DispOfSz[4]
|
||||
param varying float NorOfSz[4]
|
||||
varying float sAdj
|
||||
varying float tAdj
|
||||
varying normal Un
|
||||
varying float b0::amp
|
||||
varying normal b1::Nref
|
||||
varying vector b1::dPds
|
||||
varying vector b1::dPdt
|
||||
varying color b1::Ncolor
|
||||
varying vector b1::Nvector
|
||||
varying vector b1::Ntransformed
|
||||
|
||||
|
||||
segment Init
|
||||
pushif 1
|
||||
pop Disp
|
||||
pushif 1
|
||||
pop Nor
|
||||
pushif 0.5
|
||||
pop Mid
|
||||
pushis ""
|
||||
pop DispMap
|
||||
pushis ""
|
||||
pop NorMap
|
||||
pushif 0
|
||||
pushif 0
|
||||
ipop DispOfSz
|
||||
pushif 0
|
||||
pushif 1
|
||||
ipop DispOfSz
|
||||
pushif 1
|
||||
pushif 2
|
||||
ipop DispOfSz
|
||||
pushif 1
|
||||
pushif 3
|
||||
ipop DispOfSz
|
||||
pushif 0
|
||||
pushif 0
|
||||
ipop NorOfSz
|
||||
pushif 0
|
||||
pushif 1
|
||||
ipop NorOfSz
|
||||
pushif 1
|
||||
pushif 2
|
||||
ipop NorOfSz
|
||||
pushif 1
|
||||
pushif 3
|
||||
ipop NorOfSz
|
||||
|
||||
|
||||
segment Code
|
||||
pushv N
|
||||
pop Un
|
||||
S_CLEAR
|
||||
pushis ""
|
||||
pushv DispMap
|
||||
ness
|
||||
S_GET
|
||||
RS_PUSH
|
||||
RS_GET
|
||||
RS_JZ 0
|
||||
pushif 0
|
||||
ipushv DispOfSz
|
||||
pushif 2
|
||||
pushif 1
|
||||
pushif 2
|
||||
ipushv DispOfSz
|
||||
subff
|
||||
divff
|
||||
pushif 2
|
||||
ipushv DispOfSz
|
||||
pushv s
|
||||
mulff
|
||||
subff
|
||||
addff
|
||||
pop sAdj
|
||||
pushif 1
|
||||
ipushv DispOfSz
|
||||
pushif 2
|
||||
pushif 1
|
||||
pushif 3
|
||||
ipushv DispOfSz
|
||||
subff
|
||||
divff
|
||||
pushif 3
|
||||
ipushv DispOfSz
|
||||
pushv t
|
||||
mulff
|
||||
subff
|
||||
subff
|
||||
pop tAdj
|
||||
pushv Mid
|
||||
pushv tAdj
|
||||
pushv sAdj
|
||||
pushif 0
|
||||
pushv DispMap
|
||||
pushif 0
|
||||
ftexture2
|
||||
subff
|
||||
pushv Disp
|
||||
mulff
|
||||
pop b0::amp
|
||||
pushv N
|
||||
normalize
|
||||
pushv b0::amp
|
||||
mulfp
|
||||
pushv P
|
||||
addpp
|
||||
pop P
|
||||
pushv P
|
||||
calculatenormal
|
||||
pop Un
|
||||
:0
|
||||
RS_POP
|
||||
S_CLEAR
|
||||
pushis ""
|
||||
pushv NorMap
|
||||
ness
|
||||
S_GET
|
||||
RS_PUSH
|
||||
RS_GET
|
||||
RS_JZ 2
|
||||
pushv Un
|
||||
normalize
|
||||
pop b1::Nref
|
||||
pushv s
|
||||
pushv P
|
||||
pDeriv
|
||||
normalize
|
||||
pop b1::dPds
|
||||
pushv t
|
||||
pushv P
|
||||
pDeriv
|
||||
normalize
|
||||
pop b1::dPdt
|
||||
pushif 0
|
||||
ipushv NorOfSz
|
||||
pushif 2
|
||||
pushif 1
|
||||
pushif 2
|
||||
ipushv NorOfSz
|
||||
subff
|
||||
divff
|
||||
pushif 2
|
||||
ipushv NorOfSz
|
||||
pushv s
|
||||
mulff
|
||||
subff
|
||||
addff
|
||||
pop sAdj
|
||||
pushif 1
|
||||
ipushv NorOfSz
|
||||
pushif 2
|
||||
pushif 1
|
||||
pushif 3
|
||||
ipushv NorOfSz
|
||||
subff
|
||||
divff
|
||||
pushif 3
|
||||
ipushv NorOfSz
|
||||
pushv t
|
||||
mulff
|
||||
subff
|
||||
subff
|
||||
pop tAdj
|
||||
pushv tAdj
|
||||
pushv sAdj
|
||||
pushif 0
|
||||
pushv NorMap
|
||||
pushif 0
|
||||
ctexture2
|
||||
pop b1::Ncolor
|
||||
pushif 1
|
||||
pushif 1
|
||||
pushif 1
|
||||
settv
|
||||
pushif 2
|
||||
setfv
|
||||
pushv b1::Ncolor
|
||||
setcv
|
||||
mulpp
|
||||
subpp
|
||||
pop b1::Nvector
|
||||
pushif 2
|
||||
pushv b1::Nref
|
||||
setnc
|
||||
comp
|
||||
pushif 2
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
pushif 2
|
||||
pushv b1::dPdt
|
||||
setvc
|
||||
comp
|
||||
pushif 1
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
pushif 2
|
||||
pushv b1::dPds
|
||||
setvc
|
||||
comp
|
||||
pushif 0
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
addff
|
||||
addff
|
||||
pushif 1
|
||||
pushv b1::Nref
|
||||
setnc
|
||||
comp
|
||||
pushif 2
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
pushif 1
|
||||
pushv b1::dPdt
|
||||
setvc
|
||||
comp
|
||||
pushif 1
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
pushif 1
|
||||
pushv b1::dPds
|
||||
setvc
|
||||
comp
|
||||
pushif 0
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
addff
|
||||
addff
|
||||
pushif 0
|
||||
pushv b1::Nref
|
||||
setnc
|
||||
comp
|
||||
pushif 2
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
pushif 0
|
||||
pushv b1::dPdt
|
||||
setvc
|
||||
comp
|
||||
pushif 1
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
pushif 0
|
||||
pushv b1::dPds
|
||||
setvc
|
||||
comp
|
||||
pushif 0
|
||||
pushv b1::Nvector
|
||||
setvc
|
||||
comp
|
||||
mulff
|
||||
addff
|
||||
addff
|
||||
settv
|
||||
pop b1::Ntransformed
|
||||
pushif 2
|
||||
pushv Nor
|
||||
divff
|
||||
pushv b1::Ntransformed
|
||||
normalize
|
||||
pushv Un
|
||||
nmix
|
||||
pop N
|
||||
:2
|
||||
RS_INVERSE
|
||||
RS_JZ 1
|
||||
pushv Un
|
||||
pop N
|
||||
:1
|
||||
RS_POP
|
||||
26
src/meshlab/render_template/default/Shaders/MOSAICfog.sl
Normal file
26
src/meshlab/render_template/default/Shaders/MOSAICfog.sl
Normal file
@ -0,0 +1,26 @@
|
||||
/* MOSAIC default atmosphere shader for Blender integration */
|
||||
volume
|
||||
MOSAICfog(
|
||||
float Sta=0; //Standard Blender world controls
|
||||
float Di=0;
|
||||
float Hi=0;
|
||||
float Misi=0;
|
||||
float isMist=0;
|
||||
float MistType=0;
|
||||
color MistCol=0;)
|
||||
{
|
||||
if (isMist > 0 && Sta < Di) //Are we using mist?
|
||||
{
|
||||
float LI = length(I)-Sta;
|
||||
float DL = Di-Sta;
|
||||
if (MistType == 0) DL = DL/clamp(LI/DL,0,1);
|
||||
else if (MistType == 1) DL = DL;
|
||||
else if (MistType == 2) DL = (DL+LI)/2;
|
||||
float d = 1-clamp(LI/DL,0,1);
|
||||
if (Hi > 0) d = mix(d,1,clamp(zcomp(transform("world",point I))/Hi,0,1));
|
||||
d = mix(d,0,Misi);
|
||||
Ci = mix(MistCol,Ci,d);
|
||||
Oi = mix(color(1,1,1),Oi,d);
|
||||
}
|
||||
}
|
||||
|
||||
165
src/meshlab/render_template/default/Shaders/MOSAICfog.slx
Normal file
165
src/meshlab/render_template/default/Shaders/MOSAICfog.slx
Normal file
@ -0,0 +1,165 @@
|
||||
volume
|
||||
AQSIS_V 1.4.2
|
||||
|
||||
|
||||
segment Data
|
||||
|
||||
USES 458752
|
||||
|
||||
param uniform float Sta
|
||||
param uniform float Di
|
||||
param uniform float Hi
|
||||
param uniform float Misi
|
||||
param uniform float isMist
|
||||
param uniform float MistType
|
||||
param uniform color MistCol
|
||||
varying float b0::LI
|
||||
varying float b0::DL
|
||||
varying float b0::d
|
||||
|
||||
|
||||
segment Init
|
||||
pushif 0
|
||||
pop Sta
|
||||
pushif 0
|
||||
pop Di
|
||||
pushif 0
|
||||
pop Hi
|
||||
pushif 0
|
||||
pop Misi
|
||||
pushif 0
|
||||
pop isMist
|
||||
pushif 0
|
||||
pop MistType
|
||||
pushif 0
|
||||
setfc
|
||||
pop MistCol
|
||||
|
||||
|
||||
segment Code
|
||||
S_CLEAR
|
||||
pushif 0
|
||||
pushv isMist
|
||||
gtff
|
||||
pushv Di
|
||||
pushv Sta
|
||||
lsff
|
||||
land
|
||||
S_GET
|
||||
RS_PUSH
|
||||
RS_GET
|
||||
RS_JZ 0
|
||||
pushv Sta
|
||||
pushv I
|
||||
length
|
||||
subff
|
||||
pop b0::LI
|
||||
pushv Sta
|
||||
pushv Di
|
||||
subff
|
||||
pop b0::DL
|
||||
S_CLEAR
|
||||
pushif 0
|
||||
pushv MistType
|
||||
eqff
|
||||
S_GET
|
||||
RS_PUSH
|
||||
RS_GET
|
||||
RS_JZ 2
|
||||
pushif 1
|
||||
pushif 0
|
||||
pushv b0::DL
|
||||
pushv b0::LI
|
||||
divff
|
||||
clamp
|
||||
pushv b0::DL
|
||||
divff
|
||||
pop b0::DL
|
||||
:2
|
||||
RS_INVERSE
|
||||
RS_JZ 1
|
||||
S_CLEAR
|
||||
pushif 1
|
||||
pushv MistType
|
||||
eqff
|
||||
S_GET
|
||||
RS_PUSH
|
||||
RS_GET
|
||||
RS_JZ 4
|
||||
pushv b0::DL
|
||||
pop b0::DL
|
||||
:4
|
||||
RS_INVERSE
|
||||
RS_JZ 3
|
||||
S_CLEAR
|
||||
pushif 2
|
||||
pushv MistType
|
||||
eqff
|
||||
S_GET
|
||||
RS_PUSH
|
||||
RS_GET
|
||||
RS_JZ 5
|
||||
pushif 2
|
||||
pushv b0::LI
|
||||
pushv b0::DL
|
||||
addff
|
||||
divff
|
||||
pop b0::DL
|
||||
:5
|
||||
RS_POP
|
||||
:3
|
||||
RS_POP
|
||||
:1
|
||||
RS_POP
|
||||
pushif 1
|
||||
pushif 0
|
||||
pushv b0::DL
|
||||
pushv b0::LI
|
||||
divff
|
||||
clamp
|
||||
pushif 1
|
||||
subff
|
||||
pop b0::d
|
||||
S_CLEAR
|
||||
pushif 0
|
||||
pushv Hi
|
||||
gtff
|
||||
S_GET
|
||||
RS_PUSH
|
||||
RS_GET
|
||||
RS_JZ 6
|
||||
pushif 1
|
||||
pushif 0
|
||||
pushv Hi
|
||||
pushv I
|
||||
pushis "world"
|
||||
transform
|
||||
zcomp
|
||||
divff
|
||||
clamp
|
||||
pushif 1
|
||||
pushv b0::d
|
||||
fmix
|
||||
pop b0::d
|
||||
:6
|
||||
RS_POP
|
||||
pushv Misi
|
||||
pushif 0
|
||||
pushv b0::d
|
||||
fmix
|
||||
pop b0::d
|
||||
pushv b0::d
|
||||
pushv Ci
|
||||
pushv MistCol
|
||||
cmix
|
||||
pop Ci
|
||||
pushv b0::d
|
||||
pushv Oi
|
||||
pushif 1
|
||||
pushif 1
|
||||
pushif 1
|
||||
settc
|
||||
cmix
|
||||
pop Oi
|
||||
:0
|
||||
RS_POP
|
||||
234
src/meshlab/render_template/default/Shaders/MOSAIClight.sl
Normal file
234
src/meshlab/render_template/default/Shaders/MOSAIClight.sl
Normal file
@ -0,0 +1,234 @@
|
||||
/* MOSAIC default light shader for Blender integration */
|
||||
|
||||
//Adjust texture st with xy offset and size
|
||||
void stAdjust(output float sAdj,tAdj;float s,t,texOfSz[4])
|
||||
{
|
||||
sAdj = (s*texOfSz[2]-(texOfSz[2]-1)/2)+texOfSz[0];
|
||||
tAdj = (t*texOfSz[3]-(texOfSz[3]-1)/2)-texOfSz[1];
|
||||
}
|
||||
|
||||
//Returns different attenuations of light depth
|
||||
float Attenuation(float Ldepth,LinAtten,SqrAtten,QuadAtten,Distance,SphereAtten;)
|
||||
{
|
||||
float attenuation = 1;
|
||||
attenuation = Distance/(LinAtten*Ldepth+SqrAtten*Ldepth*2+QuadAtten*Ldepth*Ldepth+Distance);
|
||||
if (SphereAtten > 0) attenuation *= 1-Ldepth/Distance;
|
||||
return clamp(attenuation,0,1);
|
||||
}
|
||||
|
||||
light MOSAIClight(
|
||||
float LightType=0; //Standard Blender lamp controls
|
||||
float Energy=1;
|
||||
float Dist=1;
|
||||
float SpotSi=radians(30);
|
||||
float SpotBl=radians(5);
|
||||
output float Quad1=1;
|
||||
output float Quad2=0;
|
||||
output float Quad3=0;
|
||||
point from=point "shader" (0,0,0);
|
||||
point to=point "shader" (0,0,1);
|
||||
point up=point "eye" (0,1,0);
|
||||
color LightColor= color "rgb" (1,1,1);
|
||||
float isRaytrace=0; //Lamp state toggles
|
||||
float isSphere=0;
|
||||
float Falloff=4;
|
||||
varying float ProjOfSz[4]={0,0,1,1}; //Texture mapping array as offset x/y scale x/y
|
||||
output float __nondiffuse=0; //Standard built in message passing parameters
|
||||
output float __nonspecular=0;
|
||||
output float __foglight=1;
|
||||
output float Samples=8; //User non Blender controls
|
||||
output float RaySamples=8; //User non Blender controls
|
||||
output varying float Blur=0.01;
|
||||
output varying float RayBlur=0.01;
|
||||
float Bias=0.1;
|
||||
float CausticAlpha=1.0;
|
||||
color CausticColor=1.0;
|
||||
float CausticBlur=0.05;
|
||||
float CausticSamples=64;
|
||||
float CausticThreshold=0.8;
|
||||
float CausticNoise=2.5;
|
||||
float noisefreq=0;
|
||||
float noisepow=1;
|
||||
uniform float SSSWidth=1;
|
||||
string projectionmap=""; //Projector texture
|
||||
string environmentmap=""; //Environment texture
|
||||
output string shadowname=""; //User shadow map channels
|
||||
string shadowname_px="";
|
||||
string shadowname_nx="";
|
||||
string shadowname_py="";
|
||||
string shadowname_ny="";
|
||||
string shadowname_pz="";
|
||||
string shadowname_nz="";
|
||||
string causticname=""; //User caustic map channels
|
||||
string causticname_px="";
|
||||
string causticname_nx="";
|
||||
string causticname_py="";
|
||||
string causticname_ny="";
|
||||
string causticname_pz="";
|
||||
string causticname_nz="";
|
||||
output varying color SSSDepth=0;)
|
||||
{
|
||||
uniform vector Z = normalize(to-from);
|
||||
color vis = 1;
|
||||
color envcol = LightColor;
|
||||
color shad,caus = 0;
|
||||
string shadname,causname = "";
|
||||
float sAdj,tAdj,ShadowAlpha,isSSS,SSSBias,SSSBlur,SSSSamples;
|
||||
if (Falloff == 0) //Setup for constant attenuation
|
||||
{
|
||||
Quad1 = 0;
|
||||
Quad2 = 0;
|
||||
Quad3 = 0;
|
||||
}
|
||||
else if (Falloff == 1) //Setup for inverse linear attenuation
|
||||
{
|
||||
Quad1 = 1;
|
||||
Quad2 = 0;
|
||||
Quad3 = 0;
|
||||
}
|
||||
else if (Falloff == 2) //Setup for inverse square attenuation
|
||||
{
|
||||
Quad1 = 0;
|
||||
Quad2 = 0;
|
||||
Quad3 = 1;
|
||||
}
|
||||
if (LightType == 4) //If an area light manually set attenuation and spot size and blend
|
||||
{
|
||||
Quad1 = 1;
|
||||
Quad2 = 1;
|
||||
Quad3 = 1;
|
||||
RaySamples = 2;
|
||||
}
|
||||
if (isRaytrace > 0) //If raytracing then setup use "raytrace" map name method
|
||||
{
|
||||
shadowname = "raytrace";
|
||||
Samples = RaySamples;
|
||||
Blur = RayBlur;
|
||||
}
|
||||
if (LightType == 1) //Are we a distant light?
|
||||
{
|
||||
solar (to-from,0.0)
|
||||
{
|
||||
surface("ShadowAlpha",ShadowAlpha);
|
||||
surface("isSSS",isSSS);
|
||||
surface("SSSBias",SSSBias);
|
||||
surface("SSSSamples",SSSSamples);
|
||||
surface("SSSBlur",SSSBlur);
|
||||
if (shadowname != "") shad = shadow(shadowname,Ps,"samples",Samples,"blur",Blur,"bias",Bias)*ShadowAlpha;
|
||||
if (causticname != "") caus = smoothstep(CausticThreshold,1,shadow(causticname,Ps,"samples",CausticSamples,"blur",CausticBlur,"bias",Bias))*CausticColor*CausticAlpha;
|
||||
if (CausticNoise != 0)
|
||||
{
|
||||
point PL = transform("shader",Ps);
|
||||
caus *= CausticNoise*pow(noise(PL*noisefreq),noisepow);
|
||||
}
|
||||
Cl = LightColor*Energy;
|
||||
if (isSSS > 0 && shadowname != "") SSSDepth = Cl*vis*(1-shadow(shadowname,Ps,"samples",SSSSamples,"width",SSSWidth,"blur",SSSBlur,"bias",SSSBias));
|
||||
Cl *= vis*(1-shad)+caus;
|
||||
}
|
||||
}
|
||||
else if (LightType == 2 || LightType == 4) //Are we a spot light or single light in a array of area lights?
|
||||
{
|
||||
uniform vector Y = normalize(Z^vector up);
|
||||
uniform vector X = normalize(Y^Z);
|
||||
uniform float spread = 1/tan(radians(SpotSi)*57);
|
||||
illuminate (from,Z,SpotSi)
|
||||
{
|
||||
surface("ShadowAlpha",ShadowAlpha);
|
||||
surface("isSSS",isSSS);
|
||||
surface("SSSBias",SSSBias);
|
||||
surface("SSSSamples",SSSSamples);
|
||||
surface("SSSBlur",SSSBlur);
|
||||
float sloc = spread*L.X/L.Z*0.5+0.5;
|
||||
float tloc = spread*L.Y/L.Z*0.5+0.5;
|
||||
vis *= smoothstep(cos(SpotSi),cos(SpotSi-SpotBl),(L.Z)/length(L));
|
||||
if (projectionmap != "") //Are we using a projection texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,ProjOfSz);
|
||||
vis *= color texture(projectionmap,sAdj,tAdj);
|
||||
}
|
||||
if (causticname != "") caus = smoothstep(CausticThreshold,1,shadow(causticname,Ps,"samples",CausticSamples,"blur",CausticBlur,"bias",Bias))*CausticColor*CausticAlpha;
|
||||
if (CausticNoise != 0)
|
||||
{
|
||||
point PL = transform("shader",Ps);
|
||||
caus *= CausticNoise*pow(noise(PL*noisefreq),noisepow);
|
||||
}
|
||||
if (environmentmap != "") envcol = environment(environmentmap,-L,"blur",0.5)*LightColor;
|
||||
if (shadowname != "") shad = shadow(shadowname,Ps,"samples",Samples,"blur",Blur,"bias",Bias)*ShadowAlpha;
|
||||
Cl = envcol*Attenuation(length(L),Quad1,Quad2,Quad3,Dist,isSphere)*Energy;
|
||||
if (isSSS > 0 && shadowname != "") SSSDepth = Cl*vis*(1-shadow(shadowname,Ps,"samples",SSSSamples,"width",SSSWidth,"blur",SSSBlur,"bias",SSSBias));
|
||||
Cl *= vis*(1-shad)+caus;
|
||||
}
|
||||
}
|
||||
else //Are we a point light?
|
||||
{
|
||||
illuminate (from)
|
||||
{
|
||||
surface("ShadowAlpha",ShadowAlpha);
|
||||
surface("isSSS",isSSS);
|
||||
surface("SSSBias",SSSBias);
|
||||
surface("SSSSamples",SSSSamples);
|
||||
surface("SSSBlur",SSSBlur);
|
||||
point Lworld = transform("world",L+point "world" (0,0,0))*point (1,1,-1);
|
||||
float ax = abs(xcomp(Lworld));
|
||||
float ay = abs(ycomp(Lworld));
|
||||
float az = abs(zcomp(Lworld));
|
||||
if (shadowname != "") shadname = shadowname;
|
||||
else if ((ax > ay) && (ax > az)) //Are we using X+- shadow maps?
|
||||
{
|
||||
if (xcomp(Lworld) > 0.0)
|
||||
{
|
||||
if (shadowname_px != "") shadname = shadowname_px;
|
||||
if (causticname_px != "") causname = causticname_px;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shadowname_nx != "") shadname = shadowname_nx;
|
||||
if (causticname_nx != "") causname = causticname_nx;
|
||||
}
|
||||
}
|
||||
else if ((ay > ax) && (ay > az)) //Are we using Y+- shadow maps?
|
||||
{
|
||||
if (ycomp(Lworld) > 0.0)
|
||||
{
|
||||
if (shadowname_py != "") shadname = shadowname_py;
|
||||
if (causticname_py != "") causname = causticname_py;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shadowname_ny != "") shadname = shadowname_ny;
|
||||
if (causticname_ny != "") causname = causticname_ny;
|
||||
}
|
||||
}
|
||||
else if ((az > ay) && (az > ax)) //Are we using Z+- shadow maps?
|
||||
{
|
||||
if (zcomp(Lworld) > 0.0)
|
||||
{
|
||||
if (shadowname_pz != "") shadname = shadowname_pz;
|
||||
if (causticname_pz != "") causname = causticname_pz;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shadowname_nz != "") shadname = shadowname_nz;
|
||||
if (causticname_nz != "") causname = causticname_nz;
|
||||
}
|
||||
}
|
||||
Cl = LightColor*Attenuation(length(L),Quad1,Quad2,Quad3,Dist,isSphere)*Energy;
|
||||
if (causname != "")
|
||||
{
|
||||
caus = smoothstep(CausticThreshold,1,shadow(causname,Ps,"samples",CausticSamples,"blur",CausticBlur,"bias",Bias))*CausticColor*CausticAlpha;
|
||||
if (CausticNoise != 0)
|
||||
{
|
||||
point PL = transform("shader",Ps);
|
||||
caus *= CausticNoise*pow(noise(PL*noisefreq),noisepow);
|
||||
}
|
||||
}
|
||||
if (shadname != "")
|
||||
{
|
||||
shad = shadow(shadname,Ps,"samples",Samples,"blur",Blur,"bias",Bias)*ShadowAlpha;
|
||||
if (isSSS > 0) SSSDepth = Cl*vis*(1-shadow(shadname,Ps,"samples",SSSSamples,"width",SSSWidth,"blur",SSSBlur,"bias",SSSBias));
|
||||
}
|
||||
Cl *= vis*(1-shad)+caus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/meshlab/render_template/default/Shaders/MOSAIClight.slx
Normal file
BIN
src/meshlab/render_template/default/Shaders/MOSAIClight.slx
Normal file
Binary file not shown.
257
src/meshlab/render_template/default/Shaders/MOSAICsurface.sl
Normal file
257
src/meshlab/render_template/default/Shaders/MOSAICsurface.sl
Normal file
@ -0,0 +1,257 @@
|
||||
/* MOSAIC default surface shader for Blender integration */
|
||||
|
||||
//Simulate SSS through Cl with blurred shadows
|
||||
color sssdiffuse(point P;normal N;float SSSfact,Frfact,Bkfact,Rfact,Gfact,Bfact;color SSScol,SSStex)
|
||||
{
|
||||
color C = 0;
|
||||
color SSS = 0;
|
||||
illuminance(P,N,PI)
|
||||
{
|
||||
lightsource("SSSDepth",SSS); //Get shadow info
|
||||
float f = normalize(L).N; //Figure front direction
|
||||
float b = normalize(-L).N; //Figure back direction
|
||||
C += SSS*SSScol*smoothstep(-1,1,f)*Frfact*SSSfact; //Lightside sss
|
||||
C += SSS*SSScol*SSStex*color(Rfact,Gfact,Bfact)*smoothstep(-1,1,b)*Bkfact*SSSfact; //Darkside sss
|
||||
}
|
||||
return C;
|
||||
}
|
||||
|
||||
//Adjust texture st with xy offset and size
|
||||
void stAdjust(output float sAdj,tAdj;float s,t,texOfSz[4])
|
||||
{
|
||||
sAdj = (s*texOfSz[2]-(texOfSz[2]-1)/2)+texOfSz[0];
|
||||
tAdj = (t*texOfSz[3]-(texOfSz[3]-1)/2)-texOfSz[1];
|
||||
}
|
||||
|
||||
surface
|
||||
MOSAICsurface(
|
||||
float Amb=1; //Standard Blender material controls
|
||||
float Ref=0.8;
|
||||
float Spec=0.5;
|
||||
float RayMir=1;
|
||||
float Hard=0.1;
|
||||
float Alpha=1;
|
||||
float Tralu=0;
|
||||
float Emit=0;
|
||||
float ColMix=1;
|
||||
float CmirMix=1;
|
||||
float CspMix=1;
|
||||
float TransLuMix=1;
|
||||
float SSSColMix=1;
|
||||
float IOR=1.5;
|
||||
float MirFresnel=1;
|
||||
float TranspFresnel=1;
|
||||
float OccMaxdist=1e38; //User non Blender controls
|
||||
float OccSamples=8;
|
||||
float OccEnergy=1;
|
||||
float OccMapBlur=0.01;
|
||||
float OccBias=0.3;
|
||||
float EnvSamples=8;
|
||||
float EnvBlur=0;
|
||||
output varying float ShadowAlpha=1.0;
|
||||
output varying float isSSS=1;
|
||||
output varying float SSSBlur=0.05;
|
||||
output varying float SSSBias=0.1;
|
||||
output varying float SSSSamples=64;
|
||||
float SSSFact=1.0;
|
||||
float SSSTexBlur=0.04;
|
||||
float SSSFront=0.2;
|
||||
float SSSBack=0.8;
|
||||
float SSSR=1;
|
||||
float SSSG=1;
|
||||
float SSSB=1;
|
||||
float isRayMirror=0; //Material state toggles
|
||||
float isRayTransp=0;
|
||||
float isShadeless=0;
|
||||
float isOcclusion=0;
|
||||
color SpecCol=1; //Standard Blender material colors
|
||||
color MirCol=1;
|
||||
color OccCol=1;
|
||||
color AmbCol=1;
|
||||
color SSSCol=1;
|
||||
string ColMap=""; //Standard Blender texture channels
|
||||
string AlphaMap="";
|
||||
string CspMap="";
|
||||
string RayMirMap="";
|
||||
string CmirMap="";
|
||||
string RefMap="";
|
||||
string SpecMap="";
|
||||
string HardMap="";
|
||||
string AmbMap="";
|
||||
string EmitMap="";
|
||||
string TransLuMap="";
|
||||
string OccMap=""; //User non Blender materials
|
||||
string IBLMap="";
|
||||
string EnvMap="";
|
||||
varying float ColOfSz[4]={0,0,1,1}; //Texture mapping arrays as offset x/y scale x/y
|
||||
varying float AlphaOfSz[4]={0,0,1,1};
|
||||
varying float CspOfSz[4]={0,0,1,1};
|
||||
varying float RayMirOfSz[4]={0,0,1,1};
|
||||
varying float CmirOfSz[4]={0,0,1,1};
|
||||
varying float RefOfSz[4]={0,0,1,1};
|
||||
varying float SpecOfSz[4]={0,0,1,1};
|
||||
varying float HardOfSz[4]={0,0,1,1};
|
||||
varying float AmbOfSz[4]={0,0,1,1};
|
||||
varying float EmitOfSz[4]={0,0,1,1};
|
||||
varying float TransLuOfSz[4]={0,0,1,1};)
|
||||
{
|
||||
vector In = normalize(I);
|
||||
normal Nf = normalize(faceforward(N,In));
|
||||
float sAdj,tAdj;
|
||||
if (ColMap != "") //Are we using a color texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,ColOfSz);
|
||||
Ci = color mix(Cs,color texture(ColMap,sAdj,tAdj),ColMix);
|
||||
}
|
||||
else Ci = Cs;
|
||||
if (isShadeless == 0) //Only process the rest if we are not shadeless
|
||||
{
|
||||
color Uad = color "rgb" (0,0,0);
|
||||
if (EmitMap != "" || Emit > 0) //Are we using emit controls or map?
|
||||
{
|
||||
if (EmitMap != "") //Are we using a emit texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,EmitOfSz);
|
||||
Uad += Emit*Ci+float texture(EmitMap,sAdj,tAdj);
|
||||
}
|
||||
else Uad += Emit*Ci;
|
||||
}
|
||||
if (AmbMap != "" || Amb > 0) //Are we using ambient controls or map?
|
||||
{
|
||||
float hits = 0;
|
||||
float Uam = 1;
|
||||
color Ua = ambient();
|
||||
if (isOcclusion > 0 || OccMap != "") //Is ambience supposed to be occlusion or IBL?
|
||||
{
|
||||
#if defined(DELIGHT) //Is this 3Delight style IBL?
|
||||
if (IBLMap != "") Ua += (1-indirectdiffuse(P,Nf,OccSamples,"bias",OccBias,"maxdist",OccMaxdist,"environmentmap",IBLMap))*OccEnergy;
|
||||
#endif //Is this other raytrace renderers style IBL?
|
||||
#if (defined(PRMAN)||defined(AIR)||defined(PIXIE))
|
||||
if (IBLMap != "") Ua += indirectdiffuse(P,Nf,OccSamples,"bias",OccBias,"maxdist",OccMaxdist,"environmentmap",IBLMap)*OccEnergy;
|
||||
#endif
|
||||
#if (defined(PRMAN)||defined(DELIGHT)||defined(PIXIE)) //Is this other raytrace renderers style occlusion?
|
||||
else Ua += (1-occlusion(P,Nf,OccSamples,"bias",OccBias,"maxdist",OccMaxdist))*OccCol*OccEnergy;
|
||||
#endif
|
||||
#if defined(AIR) //Is this Air style occlusion?
|
||||
else
|
||||
{
|
||||
if (OccMap == "") OccMap = "raytrace";
|
||||
normal Nunoccl = 0;
|
||||
Ua += (1-occlusion(OccMap,P,Nf,radians(90),Nunoccl,"samples",OccSamples,"bias",OccBias,"blur",OccMapBlur))*OccCol*OccEnergy;
|
||||
}
|
||||
#endif
|
||||
#if defined(AQSIS) //Is this Aqsis sytle depth map occlusion?
|
||||
if (OccMap != "") Ua += (1-occlusion(OccMap,P,Nf,0,"samples",OccSamples,"bias",OccBias,"blur",OccMapBlur))*OccCol*OccEnergy;
|
||||
#endif
|
||||
}
|
||||
if (AmbMap != "") //Are we using a ambient texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,AmbOfSz);
|
||||
Uam = float texture(AmbMap,sAdj,tAdj);
|
||||
}
|
||||
Uad += (Ua+AmbCol)*Uam*Amb;
|
||||
}
|
||||
if (RefMap != "" || Ref > 0) //Are we using ref (diffuse) controls or map?
|
||||
{
|
||||
color Udif = diffuse(Nf);
|
||||
if (Tralu > 0) Udif += diffuse(-Nf)*Tralu;
|
||||
if (RefMap != "") //Are we using a ref texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,RefOfSz);
|
||||
Uad += mix(float texture(RefMap,sAdj,tAdj)*Udif,Udif,Ref);
|
||||
}
|
||||
else Uad += Ref*Udif;
|
||||
}
|
||||
color SSSTex = 1;
|
||||
if (TransLuMap != "" && TransLuMix > 0)
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,TransLuOfSz);
|
||||
SSSTex = mix(SSSTex,color texture(TransLuMap,sAdj,tAdj,"blur",SSSTexBlur),TransLuMix);
|
||||
}
|
||||
if (isSSS > 0) //Are we using sub surface scattering?
|
||||
{
|
||||
Uad += sssdiffuse(P,Nf,SSSFact,SSSFront,SSSBack,SSSR,SSSG,SSSB,mix(Ci,SSSCol,SSSColMix),SSSTex);
|
||||
}
|
||||
Ci *= Uad;
|
||||
//Are we using raytrace or environment controls for reflection/refraction?
|
||||
if (EnvMap != "" || isRayMirror > 0 || isRayTransp > 0)
|
||||
{
|
||||
color Umc = MirCol;
|
||||
float Um = RayMir;
|
||||
if (RayMirMap != "") //Are we using a mirror texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,RayMirOfSz);
|
||||
Um = mix(RayMir,float texture(RayMirMap,sAdj,tAdj),1-RayMir);
|
||||
}
|
||||
if (CmirMap != "") //Are we using a mirror color texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,CmirOfSz);
|
||||
Umc = mix(MirCol,color texture(CmirMap,sAdj,tAdj),CmirMix);
|
||||
}
|
||||
if (EnvMap != "" || isRayMirror > 0 || isRayTransp > 0) //Are we using reflection/refraction?
|
||||
{
|
||||
vector R,T;
|
||||
float Kmr,Kmt,result;
|
||||
fresnel(In,Nf,(In.N < 0 ? 1/IOR:IOR),Kmr,Kmt,R,T);
|
||||
if (TranspFresnel > 0 && IOR > 1.0) Kmt = clamp(Kmr/TranspFresnel*12,0,1);
|
||||
else Kmt = 1;
|
||||
if (MirFresnel > 0 && IOR > 1.0) Kmr = clamp(Kmr/(MirFresnel/12),0,1);
|
||||
else Kmr = 1;
|
||||
if (EnvMap != "")
|
||||
{
|
||||
uniform string texType = "";
|
||||
textureinfo(EnvMap,"type",texType);
|
||||
if (texType == "texture" || texType == "Plain Texture")
|
||||
{
|
||||
point Pndc = transform("NDC",P);
|
||||
float tx = xcomp(Pndc);
|
||||
float ty = ycomp(Pndc);
|
||||
if (Kmr > 0) Ci = Ci*(1-Um*Kmr)+color texture(EnvMap,tx,ty,"blur",EnvBlur)*Umc*Um*Kmr;
|
||||
}
|
||||
else
|
||||
{
|
||||
T = ntransform("world",normal(T))*(1,1,-1);
|
||||
R = ntransform("world",normal(R))*(1,1,-1);
|
||||
if (Kmt > 0) Ci = Ci*Kmt+color environment(EnvMap,T,"samples",EnvSamples,"blur",EnvBlur)*(1-Kmt);
|
||||
if (Kmr > 0) Ci = Ci*(1-Um*Kmr)+color environment(EnvMap,R,"samples",EnvSamples,"blur",EnvBlur)*Umc*Um*Kmr;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isRayTransp > 0 && Kmt > 0) Ci = Ci*Kmt+trace(P,T)*(1-Kmt);
|
||||
if (isRayMirror > 0 && Kmr > 0) Ci = Ci*(1-Um*Kmr)+trace(P,R)*Umc*Um*Kmr;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SpecMap != "" || Spec > 0) //Are we using specular controls or maps?
|
||||
{
|
||||
color Usc = SpecCol;
|
||||
float Ur = Hard;
|
||||
if (HardMap != "") //Are we using a hard texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,HardOfSz);
|
||||
Ur += Hard*float texture(HardMap,sAdj,tAdj);
|
||||
}
|
||||
color Us = specular(Nf,-In,PI/Ur);
|
||||
if (CspMap != "") //Are we using a specular color texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,CspOfSz);
|
||||
Usc = mix(SpecCol,color texture(CspMap,sAdj,tAdj),CspMix);
|
||||
}
|
||||
if (SpecMap != "") //Are we using a specular map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,SpecOfSz);
|
||||
Ci += Usc*(Spec*float texture(SpecMap,sAdj,tAdj)*Us);
|
||||
}
|
||||
else Ci += Usc*Spec*Us;
|
||||
}
|
||||
}
|
||||
if (AlphaMap != "") //Are we using a alpha texture map?
|
||||
{
|
||||
stAdjust(sAdj,tAdj,s,t,AlphaOfSz);
|
||||
Oi = mix(float texture(AlphaMap,sAdj,tAdj),Alpha,Alpha);
|
||||
}
|
||||
else Oi = Os;
|
||||
Ci *= Oi;
|
||||
}
|
||||
|
||||
BIN
src/meshlab/render_template/default/Shaders/MOSAICsurface.slx
Normal file
BIN
src/meshlab/render_template/default/Shaders/MOSAICsurface.slx
Normal file
Binary file not shown.
13
src/meshlab/render_template/default/default.rib
Normal file
13
src/meshlab/render_template/default/default.rib
Normal file
@ -0,0 +1,13 @@
|
||||
##RenderMan RIB-Structure 1.1
|
||||
##Scene: Scene
|
||||
##Creator: MOSAIC Beta-0.2 for Blender
|
||||
##CreationDate: 07:55pm 03/08/2009
|
||||
##For: Mosaic
|
||||
##Frames: 1
|
||||
version 3.03
|
||||
Option "searchpath" "string archive" [ "@:.:Archives:Archives/Scenes:Archives/Groups:Archives/Materials:Archives/Lights:Archives/Cameras:Archives/Geometry:Archives/Objects" ]
|
||||
Option "searchpath" "string shader" [ "@:.:Shaders" ]
|
||||
Option "searchpath" "string texture" [ "@:.:Maps" ]
|
||||
Option "limits" "int eyesplits" [ 6 ]
|
||||
##Include Archives/Scenes/F1SB0Scene.rib
|
||||
ReadArchive "F1SB0Scene.rib"
|
||||
BIN
src/meshlab/render_template/default/default.tiff
Normal file
BIN
src/meshlab/render_template/default/default.tiff
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user