JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
CompileShaderNVidia.java
Go to the documentation of this file.
1package com.jogamp.opengl.util.glsl.sdk;
2
3import com.jogamp.opengl.*;
4
5import java.io.*;
6
7/** Precompiles a shader into NVidia binary format. Input is the
8 resource name of the shader, such as
9 "com/jogamp/opengl/impl/glsl/fixed/shader/a.fp".
10 Output is "com/jogamp/opengl/impl/glsl/fixed/shader/bin/nvidia/a.bfp". */
11
12public class CompileShaderNVidia extends CompileShader {
13 private static final String NVAPSDK;
14
15 static {
16 final String nvapSDKProp = System.getProperty("NVAPSDK");
17 if (nvapSDKProp != null) {
18 NVAPSDK = nvapSDKProp;
19 } else {
20 NVAPSDK = "C:\\nvap_sdk_0_3_x";
21 }
22 }
23
24 @Override
25 public int getBinaryFormat() {
27 }
28
29 @Override
30 public File getSDKCompilerDir() {
31 File compilerDir = new File( NVAPSDK + File.separator + "tools" + File.separator );
32 File compilerFile = new File( compilerDir, getVertexShaderCompiler());
33 if(!compilerFile.exists()) {
34 compilerDir = new File( NVAPSDK );
35 compilerFile = new File( compilerDir, getVertexShaderCompiler());
36 }
37 if(!compilerFile.exists()) {
38 throw new GLException("Can't find compiler: "+getVertexShaderCompiler() + " in : " +
39 NVAPSDK+", "+NVAPSDK + File.separator + "tools");
40 }
41 return compilerDir;
42 }
43
44 @Override
45 public String getVertexShaderCompiler() {
46 return "glslv.bat";
47 }
48
49 @Override
50 public String getFragmentShaderCompiler() {
51 return "glslf.bat";
52 }
53
54 public static void main(final String[] args) {
55 new CompileShaderNVidia().run(args);
56 }
57}
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Precompiles a shader into NVidia binary format.
Precompiles a shader into a vendor binary format.
static final int GL_NVIDIA_PLATFORM_BINARY_NV
Definition: GLES2.java:1759