Created
December 18, 2016 10:03
-
-
Save tobspr/98cc74fc1646bcc33d100972c669711e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from panda3d.core import * | |
| with open("fancy-shader.vtx.glsl", "w") as handle: | |
| handle.write(""" | |
| #version 400 | |
| void main() {} | |
| """) | |
| with open("fancy-shader.frag.glsl", "w") as handle: | |
| handle.write(""" | |
| #version 400 | |
| void main() {} | |
| """) | |
| fancy_shader_a = Shader.load(Shader.SL_GLSL, "fancy-shader.vtx.glsl", "fancy-shader.frag.glsl") | |
| print("Instance A:", fancy_shader_a, "ptr:", fancy_shader_a.this) | |
| fancy_shader_b = Shader.load(Shader.SL_GLSL, "fancy-shader.vtx.glsl", "fancy-shader.frag.glsl") | |
| print("Instance B:", fancy_shader_b, "ptr:", fancy_shader_b.this) | |
| print("Modifying fragment shader") | |
| with open("fancy-shader.vtx.glsl", "a") as handle: | |
| handle.write("// comment\n") | |
| fancy_shader_c = Shader.load(Shader.SL_GLSL, "fancy-shader.vtx.glsl", "fancy-shader.frag.glsl") | |
| print("Instance C:", fancy_shader_c, "ptr:", fancy_shader_c.this) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment