mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
update volume rendering shader
This commit is contained in:
parent
c0e042033d
commit
eca9a0ba64
@ -269,11 +269,11 @@ public class VolumeRender extends JOGLGraphicRender {
|
||||
program.allocateUniform(gl, "colorMap", (gl2, loc) -> {
|
||||
gl2.glUniform1i(loc, 1);
|
||||
});
|
||||
if (this.getRayCastingType() == RayCastingType.SPECULAR) {
|
||||
//if (this.getRayCastingType() == RayCastingType.SPECULAR) {
|
||||
program.allocateUniform(gl, "normals", (gl2, loc) -> {
|
||||
gl2.glUniform1i(loc, 2);
|
||||
});
|
||||
}
|
||||
// }
|
||||
program.allocateUniform(gl, "brightness", (gl2, loc) -> {
|
||||
gl2.glUniform1f(loc, this.getBrightness());
|
||||
});
|
||||
|
||||
@ -11,6 +11,7 @@ uniform mat4 iV;
|
||||
uniform mat4 iP;
|
||||
|
||||
uniform sampler3D tex;
|
||||
uniform sampler3D normals;
|
||||
uniform sampler2D colorMap;
|
||||
uniform int depthSampleCount;
|
||||
uniform vec3 aabbMin;
|
||||
|
||||
@ -11,6 +11,7 @@ uniform mat4 iV;
|
||||
uniform mat4 iP;
|
||||
|
||||
uniform sampler3D tex;
|
||||
uniform sampler3D normals;
|
||||
uniform sampler2D colorMap;
|
||||
uniform int depthSampleCount;
|
||||
uniform vec3 aabbMin;
|
||||
|
||||
@ -267,6 +267,29 @@ public class DimArray {
|
||||
return new DimArray(rr, dims);
|
||||
}
|
||||
|
||||
/**
|
||||
* Section
|
||||
* @param ranges ranges
|
||||
* @return Section result dim array
|
||||
* @throws InvalidRangeException
|
||||
*/
|
||||
public DimArray section(List<Range> ranges) throws InvalidRangeException {
|
||||
Array r = this.array.section(ranges);
|
||||
Array rr = Array.factory(r.getDataType(), r.getShape());
|
||||
MAMath.copy(rr, r);
|
||||
Section section = new Section(ranges);
|
||||
List<Dimension> dims = new ArrayList<>();
|
||||
for (int i = 0; i < section.getRank(); i++) {
|
||||
Range range = section.getRange(i);
|
||||
if (range.length() > 1) {
|
||||
Dimension dim = this.dimensions.get(i).extract(range);
|
||||
dims.add(dim);
|
||||
}
|
||||
}
|
||||
|
||||
return new DimArray(rr, dims);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.array.toString();
|
||||
|
||||
@ -22,13 +22,11 @@
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_perspective.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_perspective_2.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_perspective_1.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_1.py"/>
|
||||
</OpenedFiles>
|
||||
<RecentFiles>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_perspective.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_perspective_2.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_perspective_1.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\volume\volumeplot_1.py"/>
|
||||
</RecentFiles>
|
||||
</File>
|
||||
<Font>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user