1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00
occt/tests/v3d/glsl/phong_plastic
kgv 8e0a2b19ab 0029074: Visualization, TKOpenGl - support Geometry Shader definition
Graphic3d_TypeOfShaderObject enumeration has been extended by Geometry shader object type.
OpenGl_ShaderProgram::Initialize() processes new shader object types when supported by OpenGL version.
Declarations.glsl has been fixed so that occFragColor is defined only for
Fragment Shader object only (by handling new FRAGMENT_SHADER macros).

Improved documentation of Graphic3d_ArrayOfPrimitives class.

vshader Draw Harness command has been extended to support definition
of Shader Object types other than Vertex and Fragment shader.
2017-09-22 11:51:36 +03:00

34 lines
765 B
Plaintext

puts "========"
puts "Per-pixel lighting using GLSL program (Phong shading), check plastic material"
puts "========"
# create box
box b 1 2 3
# draw box
vclear
vclose ALL
vinit View1
vsetdispmode 1
vaxo
vdisplay b
vsetmaterial b PLASTIC
vsetcolor b GREEN
vfit
vrotate 0.2 0.0 0.0
# take snapshot with fixed pipeline
vdump $::imagedir/${::casename}_OFF.png
set aColorL [vreadpixel 150 250 rgb name]
set aColorR [vreadpixel 250 250 rgb name]
if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } {
puts "Error: wrong color (fixed pipeline)!"
}
vshaderprog b phong
set aColorL [vreadpixel 150 250 rgb name]
set aColorR [vreadpixel 250 250 rgb name]
if { "$aColorL" != "GREEN3" || "$aColorR" != "GREEN4" } {
puts "Error: wrong color (Phong shader)!"
}