diff options
Diffstat (limited to 'src/CgShaderTest/SphereCg.java')
-rw-r--r-- | src/CgShaderTest/SphereCg.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/CgShaderTest/SphereCg.java b/src/CgShaderTest/SphereCg.java index a5664ce..266d523 100644 --- a/src/CgShaderTest/SphereCg.java +++ b/src/CgShaderTest/SphereCg.java @@ -121,11 +121,15 @@ public class SphereCg extends Applet { e.printStackTrace(); System.exit(1); } - CgVertexShader vertexShader = new CgVertexShader(vertexProgram); - CgFragmentShader fragmentShader = new CgFragmentShader(fragmentProgram); - CgShaderProgram shaderProgram = new CgShaderProgram(); - shaderProgram.setVertexShader(vertexShader); - shaderProgram.setFragmentShader(fragmentShader); + Shader[] shaders = new Shader[2]; + shaders[0] = new SourceCodeShader(Shader.SHADING_LANGUAGE_CG, + Shader.SHADER_TYPE_VERTEX, + vertexProgram); + shaders[1] = new SourceCodeShader(Shader.SHADING_LANGUAGE_CG, + Shader.SHADER_TYPE_FRAGMENT, + fragmentProgram); + ShaderProgram shaderProgram = new CgShaderProgram(); + shaderProgram.setShaders(shaders); a.setShaderProgram(shaderProgram); a.setMaterial(m); |