Java 类com.badlogic.gdx.graphics.g3d.Attributes 实例源码

项目:Argent    文件:ShadowMapShader.java   
@Override
public void render(final Renderable renderable, final Attributes combinedAttributes)  {
    boolean firstCall = true;
    for(final LightWrapper light : lights) {
        light.applyToShader(program);
        if(firstCall){
            context.setDepthTest(GL20.GL_LEQUAL);
            context.setBlending(false, GL20.GL_ONE, GL20.GL_ONE);
            super.render(renderable, combinedAttributes);
            firstCall = false;
        }else{
            context.setDepthTest(GL20.GL_EQUAL);
            context.setBlending(true, GL20.GL_ONE, GL20.GL_ONE);
            renderable.meshPart.render(program, false);
        }
    }
}
项目:Argent    文件:VolumetricDepthShader.java   
@Override
public void render(final Renderable renderable, final Attributes combinedAttributes) {
    renderable.meshPart.primitiveType = GL20.GL_TRIANGLES;
    final boolean[] firstCall = {true};
    lights.forEach(l -> {
        l.applyToShader(program);
        if(Gdx.input.isKeyJustPressed(Input.Keys.L))
        for (String s : program.getUniforms()) {
            System.out.println(s);
        }
        if(true) {
            context.setDepthTest(GL20.GL_LEQUAL);
            context.setBlending(false, GL20.GL_ONE, GL20.GL_ONE);
            super.render(renderable, combinedAttributes);
            firstCall[0] = false;
        }else{
            context.setDepthTest(GL20.GL_EQUAL);
            context.setBlending(true, GL20.GL_ONE, GL20.GL_ONE);
            MeshPart part = renderable.meshPart;
            part.mesh.render(program, part.primitiveType, part.offset, part.size, false);
        }
    });
}
项目:origin    文件:ShadowShader.java   
@Override
    public void render(Renderable renderable, Attributes combinedAttributes)
    {

//      context.setCullFace(GL_BACK);
        // Classic depth test
        context.setDepthTest(GL20.GL_LEQUAL);
        // Deactivate blending on first pass
        context.setBlending(false, GL20.GL_ONE, GL20.GL_ONE);

        context.setDepthMask(true);

        if (!combinedAttributes.has(BlendingAttribute.Type))
            context.setBlending(false, GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);

        super.render(renderable, combinedAttributes);


//      program.begin();
//      super.render(renderable, combinedAttributes);
//      program.end();
    }
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    if (renderable.environment == null)
        shader.program.setUniform3fv(shader.loc(inputID), ones, 0, ones.length);
    else {
        renderable.worldTransform.getTranslation(tmpV1);
        if (renderable.environment.has(ColorAttribute.AmbientLight))
            cacheAmbientCubemap.set(((ColorAttribute)renderable.environment.get(ColorAttribute.AmbientLight)).color);

        for (int i = dirLightsOffset; i < renderable.environment.directionalLights.size; i++)
            cacheAmbientCubemap.add(renderable.environment.directionalLights.get(i).color,
                renderable.environment.directionalLights.get(i).direction);

        for (int i = pointLightsOffset; i < renderable.environment.pointLights.size; i++)
            cacheAmbientCubemap.add(renderable.environment.pointLights.get(i).color,
                renderable.environment.pointLights.get(i).position, tmpV1,
                renderable.environment.pointLights.get(i).intensity);

        cacheAmbientCubemap.clamp();

        shader.program.setUniform3fv(shader.loc(inputID), cacheAmbientCubemap.data, 0, cacheAmbientCubemap.data.length);
    }
}
项目:Argent    文件:SimpleTextureShader.java   
@Override
public void render(final Renderable renderable, final Attributes combinedAttributes)  {
    try{
        super.render(renderable, combinedAttributes);
    }catch (NullPointerException npe) {

    }
}
项目:Argent    文件:DynamicShader.java   
@Override public void render(final Renderable renderable, final Attributes combinedAttributes) {
    renderable.meshPart.primitiveType = info.primitive.id;
    try {

        super.render(renderable, combinedAttributes);
    }catch (Exception e) {
        e.printStackTrace();
    }
}
项目:origin    文件:ModelShader.java   
@Override
public void set(BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes)
{
    if (com.a2client.Config.getInstance()._renderShadows)
    {
        shader.set(inputID, Render.toShadowMapSpace);
    }
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    for (int i = 0; i < bones.length; i++) {
        final int idx = i / 16;
        bones[i] = (renderable.bones == null || idx >= renderable.bones.length || renderable.bones[idx] == null) ? idtMatrix.val[i % 16]
            : renderable.bones[idx].val[i % 16];
    }
    shader.program.setUniformMatrix4fv(shader.loc(inputID), bones, 0, bones.length);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    if (combinedAttributes.has(CubemapAttribute.EnvironmentMap)) {
        shader.set(inputID, shader.context.textureBinder.bind(((CubemapAttribute)combinedAttributes
            .get(CubemapAttribute.EnvironmentMap)).textureDescription));
    }
}
项目:libgdxcn    文件:BaseShader.java   
public void render (Renderable renderable, final Attributes combinedAttributes) {
    for (int u, i = 0; i < localUniforms.size; ++i)
        if (setters.get(u = localUniforms.get(i)) != null) setters.get(u).set(this, u, renderable, combinedAttributes);
    if (currentMesh != renderable.mesh) {
        if (currentMesh != null) currentMesh.unbind(program, tempArray.items);
        currentMesh = renderable.mesh;
        currentMesh.bind(program, getAttributeLocations(renderable.mesh.getVertexAttributes()));
    }
    renderable.mesh.render(program, renderable.primitiveType, renderable.meshPartOffset, renderable.meshPartSize, false);
}
项目:Argent    文件:NormalTextureShader.java   
@Override
public void render(final Renderable renderable, final Attributes combinedAttributes)  {
    super.render(renderable, combinedAttributes);
}
项目:Argent    文件:DepthMapShader.java   
@Override
public void render(final Renderable renderable, final Attributes combinedAttributes)
{
    super.render(renderable, combinedAttributes);
}
项目:Chemtris    文件:WireframeShader.java   
@Override
public void render(Renderable renderable, Attributes combinedAttributes) {
    setPrimitiveType(renderable);
    super.render(renderable, combinedAttributes);
    restorePrimitiveType(renderable);
}
项目:origin    文件:ModelShader.java   
@Override
public void set(BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes)
{
    shader.set(inputID, Skybox.skyColor.r, Skybox.skyColor.g, Skybox.skyColor.b);
}
项目:origin    文件:ModelShader.java   
@Override
public void set(BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes)
{
    shader.set(inputID, Skybox.fogEnabled ? Skybox.fogDensity : 0f);
}
项目:origin    文件:ModelShader.java   
@Override
public void set(BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes)
{
    shader.set(inputID, Skybox.fogGradient);
}
项目:origin    文件:ModelShader.java   
@Override
public void set(BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes)
{
    shader.set(inputID, Render.clipNormal.x, Render.clipNormal.y, Render.clipNormal.z, Render.clipHeight);
}
项目:origin    文件:ModelShader.java   
@Override
public void set(BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes)
{
    shader.set(inputID, 6);
}
项目:origin    文件:ModelShader.java   
@Override
public void set(BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes)
{
    shader.set(inputID, com.a2client.Config.getInstance()._renderShadows ? ShadowBox.SHADOW_DISTANCE : -1f);
}
项目:origin    文件:ModelShader.java   
@Override
public void set(BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes)
{
    shader.set(inputID, Skybox.sunPosition);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, shader.camera.projection);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, shader.camera.view);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, shader.camera.combined);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, shader.camera.position.x, shader.camera.position.y, shader.camera.position.z,
        1.1881f / (shader.camera.far * shader.camera.far));
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, shader.camera.direction);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, shader.camera.up);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, renderable.worldTransform);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, temp.set(shader.camera.view).mul(renderable.worldTransform));
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, temp.set(shader.camera.combined).mul(renderable.worldTransform));
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, tmpM.set(renderable.worldTransform).inv().transpose());
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, ((FloatAttribute)(combinedAttributes.get(FloatAttribute.Shininess))).value);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, ((ColorAttribute)(combinedAttributes.get(ColorAttribute.Diffuse))).color);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    final int unit = shader.context.textureBinder.bind(((TextureAttribute)(combinedAttributes
        .get(TextureAttribute.Diffuse))).textureDescription);
    shader.set(inputID, unit);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    final TextureAttribute ta = (TextureAttribute)(combinedAttributes.get(TextureAttribute.Diffuse));
    shader.set(inputID, ta.offsetU, ta.offsetV, ta.scaleU, ta.scaleV);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, ((ColorAttribute)(combinedAttributes.get(ColorAttribute.Specular))).color);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    final int unit = shader.context.textureBinder.bind(((TextureAttribute)(combinedAttributes
        .get(TextureAttribute.Specular))).textureDescription);
    shader.set(inputID, unit);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    final TextureAttribute ta = (TextureAttribute)(combinedAttributes.get(TextureAttribute.Specular));
    shader.set(inputID, ta.offsetU, ta.offsetV, ta.scaleU, ta.scaleV);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    shader.set(inputID, ((ColorAttribute)(combinedAttributes.get(ColorAttribute.Emissive))).color);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    final int unit = shader.context.textureBinder.bind(((TextureAttribute)(combinedAttributes
        .get(TextureAttribute.Emissive))).textureDescription);
    shader.set(inputID, unit);
}
项目:libgdxcn    文件:DefaultShader.java   
@Override
public void set (BaseShader shader, int inputID, Renderable renderable, Attributes combinedAttributes) {
    final TextureAttribute ta = (TextureAttribute)(combinedAttributes.get(TextureAttribute.Emissive));
    shader.set(inputID, ta.offsetU, ta.offsetV, ta.scaleU, ta.scaleV);
}