@Override public void main() { super.main(); RVec4 color = (RVec4) getGlobal(DefaultShaderVar.G_COLOR); RVec4 skyColor = new RVec4("skyColor"); RVec3 texCoord = (RVec3) getGlobal(DefaultShaderVar.V_CUBE_TEXTURE_COORD); int cubeMapCount = 0; for (int i = 0; i < mTextures.size(); ++i) { if(mTextures.get(i).getTextureType() == TextureType.CUBE_MAP) { skyColor.assign(textureCube(muCubeTextures[cubeMapCount++], texCoord)); } skyColor.assignMultiply(muInfluence[i]); color.assignAdd(skyColor); } }
@Override public void main() { super.main(); RVec4 color = (RVec4)getGlobal(DefaultShaderVar.G_COLOR); RVec2 textureCoord = (RVec2)getGlobal(DefaultShaderVar.G_TEXTURE_COORD); RVec4 texColor = new RVec4("texColor"); for(int i=0; i<mTextures.size(); i++) { ATexture texture = mTextures.get(i); if(texture.offsetEnabled()) textureCoord.assignAdd(getGlobal(DefaultShaderVar.U_OFFSET, i)); if(texture.getWrapType() == WrapType.REPEAT) textureCoord.assignMultiply(getGlobal(DefaultShaderVar.U_REPEAT, i)); if(texture.getTextureType() == TextureType.VIDEO_TEXTURE) texColor.assign(texture2D(muVideoTextures[videoTextureMap.indexOf(i)], textureCoord)); else texColor.assign(texture2D(muTextures[textureMap.indexOf(i)], textureCoord)); texColor.assignMultiply(muInfluence[i]); color.assignAdd(texColor); } }
specColor.assignMultiply(muInfluence[i]); specMapColor.assignAdd(specColor);
specColor.assignMultiply(muInfluence[i]); specMapColor.assignAdd(specColor);
cmColor.assignMultiply(muInfluence[i]); color.assignAdd(cmColor);
@Override public void main() { super.main(); RVec4 color = (RVec4)getGlobal(DefaultShaderVar.G_COLOR); RVec2 textureCoord = (RVec2)getGlobal(DefaultShaderVar.G_TEXTURE_COORD); RVec4 texColor = new RVec4("texColor"); for(int i=0; i<mTextures.size(); i++) { ATexture texture = mTextures.get(i); if(texture.offsetEnabled()) textureCoord.assignAdd(getGlobal(DefaultShaderVar.U_OFFSET, i)); if(texture.getWrapType() == WrapType.REPEAT) textureCoord.assignMultiply(getGlobal(DefaultShaderVar.U_REPEAT, i)); if(texture.getTextureType() == TextureType.VIDEO_TEXTURE) texColor.assign(texture2D(muVideoTextures[i], textureCoord)); else texColor.assign(texture2D(muTextures[i], textureCoord)); texColor.assignMultiply(muInfluence[i]); color.assignAdd(texColor); } }
@Override public void main() { super.main(); RVec4 color = (RVec4) getGlobal(DefaultShaderVar.G_COLOR); RVec4 skyColor = new RVec4("skyColor"); RVec3 texCoord = (RVec3) getGlobal(DefaultShaderVar.V_CUBE_TEXTURE_COORD); int cubeMapCount = 0; for (int i = 0; i < mTextures.size(); ++i) { if(mTextures.get(i).getTextureType() == TextureType.CUBE_MAP) { skyColor.assign(textureCube(muCubeTextures[cubeMapCount++], texCoord)); } skyColor.assignMultiply(muInfluence[i]); color.assignAdd(skyColor); } }
v.assignSubtract(0); v.assignSubtract(v); v.assignMultiply(0); v.assignMultiply(v); v.r().assign(0); v.r().assign(0x00);
cmColor.assignMultiply(muInfluence[i]); color.assignAdd(cmColor);