This file contains 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
// This function looks up in the vertice table wheter a vertice at that position already exists | |
// - If yes, return the vertice index | |
// - If no, create a new vertice and return the created vertice index | |
// | |
// @param cfg: Pointer to a chunkConfig struct | |
// @param w_vertex: Pointer to the vertex writer | |
// @param w_texcoord: Pointer to the texcoord writer | |
// @param x: x position of the vertice | |
// @param y: y position of the vertice |
This file contains 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
geomFormat = GeomVertexFormat.getV3t2() | |
vertexData = GeomVertexData("vertices", geomFormat, Geom.UHStatic) | |
vertexWriter = GeomVertexWriter(vertexData, "vertex") | |
texcoordWriter = GeomVertexWriter(vertexData, "texcoord") | |
triangle = GeomTriangles(Geom.UHStatic) | |
vertexWriter.reserveNumRows(len(text) * 6) | |
texcoordWriter.reserveNumRows(len(text) * 6) | |
triangle.reserveNumVertices(len(text) * 2) |
This file contains 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
Index: panda/src/glstuff/glGraphicsStateGuardian_src.cxx | |
=================================================================== | |
RCS file: /cvsroot/panda3d/panda/src/glstuff/glGraphicsStateGuardian_src.cxx,v | |
retrieving revision 1.471 | |
diff -u -r1.471 glGraphicsStateGuardian_src.cxx | |
--- panda/src/glstuff/glGraphicsStateGuardian_src.cxx 20 Jun 2014 15:04:39 -0000 1.471 | |
+++ panda/src/glstuff/glGraphicsStateGuardian_src.cxx 21 Jun 2014 21:29:25 -0000 | |
@@ -1115,6 +1115,19 @@ | |
_supports_compute_shaders = true; | |
} |
This file contains 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
@classmethod | |
def simplifyGeom(self, geom, state): | |
print "Simplifying geom", geom | |
v1 = Vertex(Vec3(0, 0, 1), Vec3(0, 1, 0), Vec2(0, 1), Vec3(1,0,0)) | |
v2 = Vertex(Vec3(0, 1, 0), Vec3(0, 1, 0), Vec2(1, 0), Vec3(0,1,0)) | |
v3 = Vertex(Vec3(0, 0, 0), Vec3(0, 1, 0), Vec2(0, 0), Vec3(0,0,1)) | |
tri = Triangle(v1, v2, v3) |
This file contains 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
for (int i = 0; i < 4096; i++) { | |
lightingResult += lightData[i%64][0] * 0.01; | |
} |
This file contains 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
// Cut light transition starting at 80%. Otherwise it's exponential and never gets really 0 | |
float cutoff = light.radius * 0.8; | |
float cutoffFactor = 0.25; | |
attenuation *= 1.0 - smoothstep(0.0, 1.0, ((distanceToLight / cutoff) - 1.0) * 4.0 ); | |
attenuation = max(0.0, attenuation); |
This file contains 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
vec4 result = vec4(0, 0, 0, 1); | |
int abc = 0; | |
for (int i = 0; i < 2000; i ++) { | |
abc += i; | |
} | |
result.x = float(abc) / 200000.0; | |
ivec2 storePos = ivec2(gl_GlobalInvocationID.xy); | |
imageStore(destTex, storePos, result); |
This file contains 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
#version 430 | |
layout (rgba8) uniform image2D destTex; | |
layout (local_size_x = 32, local_size_y = 32) in; | |
void main() { | |
vec4 result = vec4(0, 0, 0, 1); | |
int abc = 0; | |
for (int i = 0; i < 2000; i ++) { | |
abc += i; | |
} |
This file contains 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 * | |
from direct.directbase import DirectStart | |
import math | |
# Shader | |
compute_source = """#version 430 | |
layout (rgba8) uniform image2D destTex; | |
layout (local_size_x = 32, local_size_y = 32) in; | |
void main() { |
This file contains 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 * | |
loadPrcFileData("",""" | |
show-frame-rate-meter #t | |
""".strip()) | |
from direct.directbase import DirectStart | |
import math |
OlderNewer