Sha256: 1bd90d608ffc137a6d9fd99a0e3554d6fdca5ef359fd45d483cf5e3d1925c5ca

Contents?: true

Size: 745 Bytes

Versions: 6

Compression:

Stored size: 745 Bytes

Contents

package org.sunflow.core.shader;

import org.sunflow.SunflowAPI;
import org.sunflow.core.ParameterList;
import org.sunflow.core.Shader;
import org.sunflow.core.ShadingState;
import org.sunflow.image.Color;
import org.sunflow.math.Vector3;

public class IDShader implements Shader {

    @Override
    public boolean update(ParameterList pl, SunflowAPI api) {
        return true;
    }

    @Override
    public Color getRadiance(ShadingState state) {
        Vector3 n = state.getNormal();
        float f = n == null ? 1.0f : Math.abs(state.getRay().dot(n));
        return new Color(state.getInstance().hashCode()).mul(f);
    }

    @Override
    public void scatterPhoton(ShadingState state, Color power) {
    }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
joonsrenderer-1.3.1-java src/main/java/org/sunflow/core/shader/IDShader.java
joonsrenderer-1.2.0-java src/main/java/org/sunflow/core/shader/IDShader.java
joonsrenderer-1.1.3-java src/main/java/org/sunflow/core/shader/IDShader.java
joonsrenderer-1.1.2-java src/main/java/org/sunflow/core/shader/IDShader.java
joonsrenderer-1.1.1-java src/main/java/org/sunflow/core/shader/IDShader.java
joonsrenderer-1.1-java src/main/java/org/sunflow/core/shader/IDShader.java