本文整理汇总了Python中shader.Shader.uLightDiffuseBrightness方法的典型用法代码示例。如果您正苦于以下问题:Python Shader.uLightDiffuseBrightness方法的具体用法?Python Shader.uLightDiffuseBrightness怎么用?Python Shader.uLightDiffuseBrightness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shader.Shader
的用法示例。
在下文中一共展示了Shader.uLightDiffuseBrightness方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_window
# 需要导入模块: from shader import Shader [as 别名]
# 或者: from shader.Shader import uLightDiffuseBrightness [as 别名]
def create_window(self):
logger.info("Creating window")
dummy_win = glutCreateWindow("Initializing...")
glutDisplayFunc(self.dummy_cb)
glutHideWindow(dummy_win)
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA
| GLUT_DEPTH)
glutDestroyWindow(dummy_win)
logger.debug("Setting glut WindowSize")
glutInitWindowSize(self.width, self.height)
logger.debug("Creating glutWindow")
self.windows = {}
# self.windows.append(glutCreateWindow("Robotviewer Server"))
self.shaders = display_object.shaders
for i in range(self.num_windows):
window = GlWindow(server = self)
glutDisplayFunc(self.draw_cb)
glutReshapeFunc(self.resize_cb)
self.windows[window.id] = window
glutEntryFunc(self.enter_leave_cb);
glutVisibilityFunc(self.visible_cb);
self.bind_events()
glutPositionWindow(i*self.width,20);
self.init_lights()
cam = Camera(server = self)
cam.translation = [3.5, 0, 1]
cam.width = self.width
cam.height = self.height
cam_name = "world_camera%d"%window.id
cam.name = cam_name
cam.init()
self.elements[cam_name] = cam
self.world_cameras.append(cam)
self.cameras.append(cam)
window.active_camera = len(self.world_cameras) -1
window.cameras = self.cameras
print "use_shader=", self.use_shader
if not self.use_shader:
continue
p = os.path.abspath(os.path.dirname(__file__))
vs_text = open(os.path.join(p,'vertex_shader.c')).read()
fs_text = open(os.path.join(p,'fragment_shader.c')).read()
program = compileProgram(compileShader(vs_text, GL_VERTEX_SHADER),
compileShader(fs_text, GL_FRAGMENT_SHADER),
)
shader = Shader(program)
glUseProgram(program)
self.specular_highlights = True
shader.uShowSpecularHighlights = self.specular_highlights
shader.uAmbientLightingColor = self.light_ambient_color + [1.]
shader.uPointLightingLocation = self.light0_position
shader.uPointLightingDiffuseColor = self.light0_diffuse_color + [1.]
shader.uPointLightingSpecularColor = self.light0_specular_color + [1.]
shader.uMaterialShininess = self.shininess
shader.uModernShader = self.modern_shader
shader.uLightSpecularBrightness = self.light_specular_brightness
shader.uLightDiffuseBrightness = self.light_diffuse_brightness
shader.uMaxSpecular = self.max_specular
shader.uMaterialAmbientIntensity = 0.2
self.shaders[glutGetWindow()] = shader
glutIdleFunc(self.refresh_cb)