@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); } }
@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() { RVec2 v = new RVec2("v"); v.assign(0); v.assign(0, 0); v.assignAdd(0); v.assignAdd(v); v.assignSubtract(0); v.assignSubtract(v); v.assignMultiply(0); v.assignMultiply(v); v.s().assign(0); v.s().assign(0x00); v.s().assign("(0+0)"); v.t().assign(0); v.t().assign(0x00); v.t().assign("(0+0)"); v.x().assign(0); v.x().assign(0x00); v.x().assign("(0+0)"); v.y().assign(0); v.y().assign(0x00); v.y().assign("(0+0)"); } };
@Override public void main() { RVec2 textureCoord = (RVec2)getGlobal(DefaultShaderVar.G_TEXTURE_COORD); RVec4 decalCol = new RVec4("decalCol"); if(mDecalTexture.offsetEnabled()) textureCoord.assignAdd(muDecalOffset); if(mDecalTexture.getWrapType() == ATexture.WrapType.REPEAT) textureCoord.assignMultiply(muDecalRepeat); decalCol.assign(texture2D(muDecalTexture, textureCoord)); RVec4 color = (RVec4) getGlobal(DefaultShaderVar.G_COLOR); color.assign(mix(color, decalCol, decalCol.a())); } }