Created
February 16, 2017 17:13
-
-
Save DCubix/55ba3a3284f8dea0893a31617f18381c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 bge import types, render, logic | |
class CustomTechnique(types.KX_RenderTechnique): | |
def __init__(self): | |
super(CustomTechnique, self).__init__() | |
self.normals_shader = types.BL_Shader(...) | |
def apply(self): | |
# render all the meshes with a specific shader | |
# If the shader override (param 2) is null, use the material | |
# We can have a function to render a single mesh and bind the textures to a shader | |
# self.renderSingleGeometry(index, shader) | |
# and self.getGeometryCount(scene) | |
# so, for i in range(self.getGeometryCount(scene)) | |
# To bind textures: | |
# self.bindTextures(mesh, shader) | |
self.renderGeometries(logic.getCurrentScene(), self.normals_shader) | |
self.postProcess() | |
def main(cont): | |
render.renderTechnique = CustomTechnique() # if renderTechnique is null, render normally, else, use the technique |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment