mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0024855: Revision of parameters of standard materials
Improve consistency and visual appearance of predefined OCCT materials in various rendering modes, including ray-tracing: - Increase the specular exponents (shininesses) for metallic surfaces: Brass, Bronze, Copper, Gold, Pewter, Silver, Steel, Chrome, Aluminum. - Revise specular colors for metals: Copper, Gold, Aluminum, Silver (according to "Real-Time Rendering, 3rd Edition", AK Peters 2008). - Increase diffuse reflection of metals: Silver, Aluminum, Chrome (to make them brighter in OpenGL mode). - Extend Material definition by Refraction Index. Advanced rendering methods based on shaders or ray-tracing can utilize it to produce refraction effects. In addition: - Introduce three translucent materials: Water, Glass, and Diamond. - Add Charcoal for modeling dark diffuse surfaces. Add new TCL-based sample (materials.tcl) and test case (tests/v3d/materials/bug24855).
This commit is contained in:
@@ -16,7 +16,7 @@ vsetdispmode 1
|
||||
vfit
|
||||
vsetcolor result GREEN
|
||||
|
||||
checkcolor $x_coord $y_coord 0.45 0.95 0.05
|
||||
checkcolor $x_coord $y_coord 0.00 0.83 0.00
|
||||
|
||||
set 3dviewer 1
|
||||
|
||||
|
@@ -22,14 +22,14 @@ vdisplay b
|
||||
vsetdispmode 1
|
||||
vsetcolor b ANTIQUEWHITE
|
||||
|
||||
checkcolor 24 55 0.75686198472976685 0 0
|
||||
checkcolor 16 76 0 0 0.50195999999999996
|
||||
checkcolor 26 107 0.18039199709892273 0.5686269998550415 0.180392
|
||||
checkcolor 34 114 0.29803898930549622 0.29803898930549622 0.298039
|
||||
checkcolor 24 131 0.61960697174072266 0 0
|
||||
checkcolor 18 139 0.21568599343299866 0 0.78431300000000004
|
||||
checkcolor 56 160 1 0 0
|
||||
checkcolor 30 160 0 1 0.90980300000000003
|
||||
checkcolor 24 55 0.753 0.000 0.000
|
||||
checkcolor 16 76 0.000 0.000 1.000
|
||||
checkcolor 25 107 0.000 1.000 0.000
|
||||
checkcolor 34 114 0.298 0.298 0.298
|
||||
checkcolor 24 131 0.922 0.000 0.000
|
||||
checkcolor 18 139 0.145 0.000 0.855
|
||||
checkcolor 56 160 1.000 0.000 0.000
|
||||
checkcolor 30 160 0.188 0.761 0.698
|
||||
|
||||
set only_screen 1
|
||||
|
||||
|
@@ -23,8 +23,8 @@ vsetcolor p_2 green
|
||||
vsettransparency p_1 0.5
|
||||
vsettransparency p_1 0
|
||||
|
||||
checkcolor 120 150 1 0.3 0.06
|
||||
checkcolor 180 273 0.39 1 0.058
|
||||
checkcolor 120 150 0.831 0.000 0.000
|
||||
checkcolor 180 273 0.000 0.753 0.000
|
||||
|
||||
set only_screen 1
|
||||
|
||||
|
@@ -43,6 +43,6 @@ if {"$aWireColor" != "HOTPINK"} {
|
||||
if {"$anEdgeColor" != "RED"} {
|
||||
puts "Error: wrong Edge color"
|
||||
}
|
||||
if {"$aFaceColor" != "LEMONCHIFFON1"} {
|
||||
if {"$aFaceColor" != "GRAY62"} {
|
||||
puts "Error: wrong Face color"
|
||||
}
|
||||
|
@@ -15,13 +15,13 @@ set y2 269
|
||||
set x3 348
|
||||
set y3 238
|
||||
|
||||
set KUB_R 0.45098000764846802
|
||||
set KUB_G 0.32941100001335144
|
||||
set KUB_B 1
|
||||
set KUB_R 0.00
|
||||
set KUB_G 0.00
|
||||
set KUB_B 0.83
|
||||
|
||||
set LINE_R 0
|
||||
set LINE_G 0
|
||||
set LINE_B 1
|
||||
set LINE_R 0.00
|
||||
set LINE_G 0.00
|
||||
set LINE_B 1.00
|
||||
|
||||
|
||||
box b1 10 10 10
|
||||
|
@@ -12,3 +12,4 @@
|
||||
012 voxel
|
||||
013 glsl
|
||||
014 raytrace
|
||||
015 materials
|
||||
|
43
tests/v3d/materials/bug24855
Normal file
43
tests/v3d/materials/bug24855
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "========"
|
||||
puts "OCC24855: Revision of parameters of standard materials"
|
||||
puts "========"
|
||||
|
||||
# custom shapes
|
||||
set aShape [locate_data_file occ/Top.brep]
|
||||
|
||||
# setup 3D viewer content
|
||||
vinit View1 w=768 h=768
|
||||
vglinfo
|
||||
|
||||
vsetgradientbg 180 200 255 180 180 180 2
|
||||
|
||||
# display shape
|
||||
vlight change 0 pos -1 1 1
|
||||
restore $aShape s
|
||||
vsetdispmode 1
|
||||
vdisplay s
|
||||
vfit
|
||||
|
||||
proc testmat {dirname filename} {
|
||||
foreach {aMatIter} {brass bronze copper gold jade neon_phc pewter obsidian plaster plastic satin silver steel stone chrome aluminium charcoal} {
|
||||
vsetmaterial -noredraw s $aMatIter
|
||||
vdump $dirname/${filename}_${aMatIter}.png
|
||||
}
|
||||
}
|
||||
|
||||
# make material screenshots
|
||||
testmat $imagedir $casename
|
||||
|
||||
vshaderprog s phong
|
||||
testmat $imagedir ${casename}_phong
|
||||
|
||||
vraytrace 1
|
||||
vtextureenv on 5
|
||||
vsetraytracemode aa=1 refl=1
|
||||
|
||||
testmat $imagedir ${casename}_rt
|
||||
|
||||
vclear
|
||||
vraytrace 0
|
||||
vtextureenv off
|
||||
source $env(CASROOT)/samples/tcl/materials.tcl
|
Reference in New Issue
Block a user