add unsigned short and int arithmetic function support

This commit is contained in:
wyq 2022-02-17 16:42:54 +08:00
parent 82ff6d08a0
commit 0acab90fde
3 changed files with 61 additions and 18 deletions

View File

@ -201,8 +201,13 @@ public class VolumeRender extends JOGLGraphicRender {
e.printStackTrace();
}
} else if (program.getProgramId() == null) {
//this.bindingTextures();
program.init(gl);
this.bindingTextures();
/*try {
compileShaders();
} catch (Exception e) {
e.printStackTrace();
}*/
//program.init(gl);
}
}
@ -258,12 +263,10 @@ public class VolumeRender extends JOGLGraphicRender {
@Override
public void draw() {
try {
//this.bindingTextures();
//this.compileShaders();
//gl.glEnable(GL_TEXTURE_2D);
//gl.glEnable(GL_TEXTURE_3D);
program.use(gl);
setUniforms();
//program.use(gl);
//program.setUniforms(gl);
IntBuffer intBuffer = IntBuffer.allocate(1);
gl.glGenBuffers(1, intBuffer);
@ -291,6 +294,8 @@ public class VolumeRender extends JOGLGraphicRender {
//Program.destroyAllPrograms(gl);
gl.glUseProgram(0);
gl.glEnable(GL_DEPTH_TEST);
//gl.glDisable(GL_TEXTURE_2D);
//gl.glDisable(GL_TEXTURE_3D);
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MeteoInfo File="milconfig.xml" Type="configurefile">
<Path OpenPath="D:\Working\MIScript\Jython\mis\io\grib">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\streamslice"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
<Path OpenPath="D:\Working\MIScript\Jython\mis\satellite\calipso">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d_earth"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
@ -13,20 +9,24 @@
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\interpolation"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\micaps"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\grib"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\satellite"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\satellite\calipso"/>
</Path>
<File>
<OpenedFiles>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\calc\potential_vorticity_baroclinic.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\calc\isentropic_analysis.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\io\grib\grib_ensemble.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_1.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\plot_cuace_3d_volume.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\satellite\calipso\CALIPSO_aerosol_type_v4-21_2.py"/>
</OpenedFiles>
<RecentFiles>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\calc\potential_vorticity_baroclinic.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\calc\isentropic_analysis.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\io\grib\grib_ensemble.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_1.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\plot_cuace_3d_volume.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\satellite\calipso\CALIPSO_aerosol_type_v4-21_2.py"/>
</RecentFiles>
</File>
<Font>

View File

@ -275,7 +275,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), b.getDataType());
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.addInt(a, b);
case FLOAT:
@ -303,7 +305,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.addInt(a, b.intValue());
case FLOAT:
@ -664,7 +668,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), b.getDataType());
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.subInt(a, b);
case FLOAT:
@ -692,7 +698,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.subInt(a, b.intValue());
case FLOAT:
@ -731,7 +739,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.subInt(b.intValue(), a);
case FLOAT:
@ -1165,7 +1175,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), b.getDataType());
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.mulInt(a, b);
case FLOAT:
@ -1190,7 +1202,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.mulInt(a, b.intValue());
case FLOAT:
@ -1602,7 +1616,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), b.getDataType());
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.divInt(a, b);
case FLOAT:
@ -1627,7 +1643,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.divInt(a, b.intValue());
case FLOAT:
@ -1663,7 +1681,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.divInt(b.intValue(), a);
case FLOAT:
@ -2158,7 +2178,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), b.getDataType());
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.modInt(a, b);
case FLOAT:
@ -2181,7 +2203,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.modInt(a, b.intValue());
case FLOAT:
@ -2204,7 +2228,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.modInt(b.intValue(), a);
case FLOAT:
@ -2556,7 +2582,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), b.getDataType());
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.floorDivInt(a, b);
case FLOAT:
@ -2579,7 +2607,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.floorDivInt(a, b.intValue());
case FLOAT:
@ -2602,7 +2632,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.floorDivInt(b.intValue(), a);
case FLOAT:
@ -2940,7 +2972,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.powInt(a, b.intValue());
case FLOAT:
@ -2975,7 +3009,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(b.getDataType(), bType);
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
case BOOLEAN:
return ArrayMath.powInt(a.intValue(), b);
case FLOAT:
@ -3009,7 +3045,9 @@ public class ArrayMath {
DataType type = ArrayMath.commonType(a.getDataType(), b.getDataType());
switch (type) {
case SHORT:
case USHORT:
case INT:
case UINT:
return ArrayMath.powInt(a, b);
case FLOAT:
case DOUBLE: