• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RajawaliRenderer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中rajawali.renderer.RajawaliRenderer的典型用法代码示例。如果您正苦于以下问题:Java RajawaliRenderer类的具体用法?Java RajawaliRenderer怎么用?Java RajawaliRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RajawaliRenderer类属于rajawali.renderer包,在下文中一共展示了RajawaliRenderer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: render

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public void render(RajawaliScene scene, RajawaliRenderer renderer, ScreenQuad screenQuad, RenderTarget writeBuffer, RenderTarget readBuffer, double deltaTime) {
	// Set the background color with that of current render pass.
	if (mClearColor != 0x00000000) {
		mOldClearColor = renderer.getCurrentScene().getBackgroundColor();
		GLES20.glClearColor(Color.red(mClearColor)/255f, Color.green(mClearColor)/255f, Color.blue(mClearColor)/255f, Color.alpha(mClearColor)/255f);
	}
	
	// Render the current scene.
	mOldCamera = mScene.getCamera();
	mScene.switchCamera(mCamera);
	mScene.render(deltaTime, readBuffer);
	mScene.switchCamera(mOldCamera);
	
	// Restore the old background color.
	if (mClearColor != 0x00000000) {
		GLES20.glClearColor(Color.red(mOldClearColor)/255f, Color.green(mOldClearColor)/255f, Color.blue(mOldClearColor)/255f, Color.alpha(mOldClearColor)/255f);
	}
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:19,代码来源:RenderPass.java


示例2: remove

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
void remove()
{
	mModelMatrix = null;
	mModelViewMatrix = null;

	if (mLights != null)
		mLights.clear();
	if (mTextureList != null)
		mTextureList.clear();

	if (RajawaliRenderer.hasGLContext()) {
		GLES20.glDeleteShader(mVShaderHandle);
		GLES20.glDeleteShader(mFShaderHandle);
		GLES20.glDeleteProgram(mProgramHandle);
	}
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:20,代码来源:Material.java


示例3: AAdvancedMaterial

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public AAdvancedMaterial(String vertexShader, String fragmentShader, int parameters) {
    super(vertexShader, fragmentShader, parameters);
    mNormalMatrix = new float[9];
    mTmp = new float[9];
    mTmp2 = new float[9];
    mAmbientColor = new float[]{.2f, .2f, .2f, 1};
    mAmbientIntensity = new float[]{.3f, .3f, .3f, 1};

    if (RajawaliRenderer.isFogEnabled())
        mFogColor = new float[]{.8f, .8f, .8f};
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:12,代码来源:AAdvancedMaterial.java


示例4: FBXParser

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public FBXParser(RajawaliRenderer renderer, String fileOnSDCard) {
    super(renderer, fileOnSDCard);
    mRenderer = renderer;
    mObjStack = new Stack<Object>();
    mFbx = new FBXValues();
    mObjStack.add(mFbx);
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:8,代码来源:FBXParser.java


示例5: WallpaperEngine

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public WallpaperEngine(SharedPreferences preferences, Context context, RajawaliRenderer renderer,
                       boolean useMultisampling) {
    mContext = context;
    mRenderer = renderer;
    mRenderer.setSharedPreferences(preferences);
    mRenderer.setEngine(this);
    mMultisampling = useMultisampling;
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:9,代码来源:Wallpaper.java


示例6: render

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public void render(RajawaliScene scene, RajawaliRenderer renderer, ScreenQuad screenQuad, RenderTarget writeTarget, RenderTarget readTarget, double deltaTime) {
	mReadTarget = readTarget;
	mWriteTarget = writeTarget;
	screenQuad.setMaterial(mMaterial);
	screenQuad.setEffectPass(this);
	
	if(mRenderToScreen == true)
		scene.render(deltaTime, null);
	else
		scene.render(deltaTime, writeTarget);
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:12,代码来源:EffectPass.java


示例7: taskReset

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public void taskReset(RajawaliRenderer renderer)
{
	if (mRenderers.size() == 0)
	{
		taskReset();
	}
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:8,代码来源:MaterialManager.java


示例8: taskReset

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
/**
 * Completely resets the TextureManager. This should only be called by {@link RajawaliRender}.
 */
public void taskReset()
{
	try {
		int count = mTextureList.size();

		int[] textures = new int[count];
		for (int i = 0; i < count; i++)
		{
			ATexture texture = mTextureList.get(i);

			if (texture.getOwnerIdentity().equals(mRenderer.getClass().toString()) || texture.willRecycle())
			{
				texture.reset();
				textures[i] = texture.getTextureId();
				mTextureList.remove(i);
				i -= 1;
				count -= 1;
			}
		}
		
		if(RajawaliRenderer.hasGLContext())
			GLES20.glDeleteTextures(count, textures, 0);

		if (mRenderers.size() > 0)
		{
			mRenderer = mRenderers.get(mRenderers.size() - 1);
			reload();
		} else {
			mTextureList.clear();
		}
	} catch (TextureException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:38,代码来源:TextureManager.java


示例9: LoaderFBX

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public LoaderFBX(RajawaliRenderer renderer, String fileOnSDCard) {
	super(renderer, fileOnSDCard);
	mRenderer = renderer;
	mObjStack = new Stack<Object>();
	mFbx = new FBXValues();
	mObjStack.add(mFbx);
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:8,代码来源:LoaderFBX.java


示例10: WallpaperEngine

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public WallpaperEngine(SharedPreferences preferences, Context context, RajawaliRenderer renderer,
		boolean useMultisampling) {
	mContext = context;
	mRenderer = renderer;
	mRenderer.setSharedPreferences(preferences);
	mRenderer.setEngine(this);
	mMultisampling = useMultisampling;
	mDefaultPreviewOffsetX = 0.5f;
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:10,代码来源:Wallpaper.java


示例11: RajawaliScene

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public RajawaliScene(RajawaliRenderer renderer) {
	mRenderer = renderer;
	mAlpha = 0;
	mAnimations = Collections.synchronizedList(new CopyOnWriteArrayList<Animation3D>());
	mChildren = Collections.synchronizedList(new CopyOnWriteArrayList<Object3D>());
	mPlugins = Collections.synchronizedList(new CopyOnWriteArrayList<IRendererPlugin>());
	mCameras = Collections.synchronizedList(new CopyOnWriteArrayList<Camera>());
	mLights = Collections.synchronizedList(new CopyOnWriteArrayList<ALight>());
	mFrameTaskQueue = new LinkedList<AFrameTask>();
	
	mCamera = new Camera();
	mCamera.setZ(mEyeZ);
	mCameras = Collections.synchronizedList(new CopyOnWriteArrayList<Camera>());
	mCameras.add(mCamera);
}
 
开发者ID:takyonxxx,项目名称:IRobot-Android,代码行数:16,代码来源:RajawaliScene.java


示例12: AAdvancedMaterial

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public AAdvancedMaterial(String vertexShader, String fragmentShader, int parameters) {
	super(vertexShader, fragmentShader, parameters);
	mNormalMatrix = new float[9];
	mTmp = new float[9];
	mTmp2 = new float[9];
	mAmbientColor = new float[] {.2f, .2f, .2f, 1};
	mAmbientIntensity = new float[] { .3f, .3f, .3f, 1 };		

	if(RajawaliRenderer.isFogEnabled())
		mFogColor = new float[] { .8f, .8f, .8f };
}
 
开发者ID:OpsLabJPL,项目名称:MarsImagesAndroid,代码行数:12,代码来源:AAdvancedMaterial.java


示例13: FBXParser

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public FBXParser(RajawaliRenderer renderer, String fileOnSDCard) {
	super(renderer, fileOnSDCard);
	mRenderer = renderer;
	mObjStack = new Stack<Object>();
	mFbx = new FBXValues();
	mObjStack.add(mFbx);
}
 
开发者ID:OpsLabJPL,项目名称:MarsImagesAndroid,代码行数:8,代码来源:FBXParser.java


示例14: WallpaperEngine

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public WallpaperEngine(SharedPreferences preferences, Context context, RajawaliRenderer renderer,
		boolean useMultisampling) {
	mContext = context;
	mRenderer = renderer;
	mRenderer.setSharedPreferences(preferences);
	mRenderer.setEngine(this);
	mMultisampling = useMultisampling;
}
 
开发者ID:OpsLabJPL,项目名称:MarsImagesAndroid,代码行数:9,代码来源:Wallpaper.java


示例15: setShaders

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
@Override
public void setShaders(String vertexShader, String fragmentShader) {
    vertexShader = replaceShaderVars(vertexShader);
    fragmentShader = replaceShaderVars(fragmentShader);

    StringBuffer lightVars = new StringBuffer();
    int numLights = mLights.size();

    for (int i = 0; i < numLights; ++i) {
        lightVars.append("uniform vec3 uLightColor").append(i).append(";\n");
        lightVars.append("uniform float uLightPower").append(i).append(";\n");
        lightVars.append("uniform int uLightType").append(i).append(";\n");
        lightVars.append("uniform vec3 uLightPosition").append(i).append(";\n");
        lightVars.append("uniform vec3 uLightDirection").append(i).append(";\n");
        lightVars.append("uniform vec4 uLightAttenuation").append(i).append(";\n");
        lightVars.append("varying float vAttenuation").append(i).append(";\n");
        lightVars.append("uniform float uSpotExponent").append(i).append(";\n");
        lightVars.append("uniform float uSpotCutoffAngle").append(i).append(";\n");
        lightVars.append("uniform float uSpotFalloff").append(i).append(";\n");
    }
    vertexShader = vertexShader.replace("%LIGHT_VARS%", lightVars.toString());
    if (mSkeletalAnimationEnabled) {
        if (mMaxWeights > 4)
            vertexShader = "\n#define VERTEX_WEIGHT_8\n" + vertexShader;
        vertexShader = vertexShader.replace("%NUM_JOINTS%", Integer.toString(mNumJoints));
    }
    fragmentShader = fragmentShader.replace("%LIGHT_VARS%", lightVars.toString());

    super.setShaders(vertexShader, fragmentShader);
    muNormalMatrixHandle = getUniformLocation("uNMatrix");
    muAmbientColorHandle = getUniformLocation("uAmbientColor");
    muAmbientIntensityHandle = getUniformLocation("uAmbientIntensity");

    muLightAttenuationHandles = new int[numLights];
    muLightColorHandles = new int[numLights];
    muLightDirectionHandles = new int[numLights];
    muLightPositionHandles = new int[numLights];
    muLightPowerHandles = new int[numLights];
    muSpotCutoffAngleHandles = new int[numLights];
    muSpotFalloffHandles = new int[numLights];

    for (int i = 0; i < mLights.size(); ++i) {
        muLightColorHandles[i] = getUniformLocation("uLightColor" + i);
        muLightPowerHandles[i] = getUniformLocation("uLightPower" + i);
        muLightPositionHandles[i] = getUniformLocation("uLightPosition" + i);
        muLightDirectionHandles[i] = getUniformLocation("uLightDirection" + i);
        muLightAttenuationHandles[i] = getUniformLocation("uLightAttenuation" + i);
        muSpotCutoffAngleHandles[i] = getUniformLocation("uSpotCutoffAngle" + i);
        muSpotFalloffHandles[i] = getUniformLocation("uSpotFalloff" + i);
    }

    if (RajawaliRenderer.isFogEnabled()) {
        muFogColorHandle = getUniformLocation("uFogColor");
        muFogNearHandle = getUniformLocation("uFogNear");
        muFogFarHandle = getUniformLocation("uFogFar");
        muFogEnabledHandle = getUniformLocation("uFogEnabled");
    }

    if (mSkeletalAnimationEnabled) {
        mvBoneIndex1Handle = getAttribLocation("vBoneIndex1");
        mvBoneWeight1Handle = getAttribLocation("vBoneWeight1");

        if (mMaxWeights > 4) {//TODO check if maxWeights > 8 -> throw exception
            mvBoneIndex2Handle = getAttribLocation("vBoneIndex2");
            mvBoneWeight2Handle = getAttribLocation("vBoneWeight2");
        }

        muBoneMatrixHandle = getUniformLocation("uBoneMatrix");
    }
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:71,代码来源:AAdvancedMaterial.java


示例16: setShaders

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public void setShaders(String vertexShader, String fragmentShader) {
    mVertexShader = mVertexAnimationEnabled ? "#define VERTEX_ANIM\n" + vertexShader : vertexShader;
    mVertexShader = mSkeletalAnimationEnabled ? "#define SKELETAL_ANIM\n" + mVertexShader : mVertexShader;
    mVertexShader = mUseColor ? mVertexShader : "#define TEXTURED\n" + mVertexShader;
    mFragmentShader = mUseColor ? fragmentShader : "#define TEXTURED\n" + fragmentShader;
    mFragmentShader = mAlphaMaskingEnabled ? "#define ALPHA_MASK\n" + mFragmentShader : mFragmentShader;
    mFragmentShader = mUseAlphaMap ? "#define ALPHA_MAP\n" + mFragmentShader : mFragmentShader;
    mFragmentShader = mUseNormalMap ? "#define NORMAL_MAP\n" + mFragmentShader : mFragmentShader;
    mFragmentShader = mUseSpecMap ? "#define SPECULAR_MAP\n" + mFragmentShader : mFragmentShader;

    if (RajawaliRenderer.isFogEnabled()) {
        mVertexShader = "#define FOG_ENABLED\n" + mVertexShader;
        mFragmentShader = "#define FOG_ENABLED\n" + mFragmentShader;
    }

    mProgram = createProgram(mVertexShader, mFragmentShader);
    if (mProgram == 0)
        return;

    maPositionHandle = getAttribLocation("aPosition");
    maNormalHandle = getAttribLocation("aNormal");
    maTextureHandle = getAttribLocation("aTextureCoord");
    maColorHandle = getAttribLocation("aColor");

    muCameraPositionHandle = getUniformLocation("uCameraPosition");
    muMVPMatrixHandle = getUniformLocation("uMVPMatrix");
    muMMatrixHandle = getUniformLocation("uMMatrix");
    muVMatrixHandle = getUniformLocation("uVMatrix");

    if (mVertexAnimationEnabled == true) {
        maNextFramePositionHandle = getAttribLocation("aNextFramePosition");
        maNextFrameNormalHandle = getAttribLocation("aNextFrameNormal");
        muInterpolationHandle = getUniformLocation("uInterpolation");
    }

    if (mAlphaMaskingEnabled == true) {
        muAlphaMaskingThresholdHandle = getUniformLocation("uAlphaMaskingThreshold");
    }

    mProgramCreated = true;

    checkTextureHandles();
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:44,代码来源:AMaterial.java


示例17: AParser

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public AParser(RajawaliRenderer renderer, String fileOnSDCard) {
    this(renderer.getContext().getResources(), 0);
    mFileOnSDCard = fileOnSDCard;
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:5,代码来源:AParser.java


示例18: ObjParser

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public ObjParser(RajawaliRenderer renderer, String fileOnSDCard) {
    super(renderer, fileOnSDCard);
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:4,代码来源:ObjParser.java


示例19: AMeshParser

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public AMeshParser(RajawaliRenderer renderer, String fileOnSDCard) {
    super(renderer, fileOnSDCard);
    mRootObject = new BaseObject3D();
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:5,代码来源:AMeshParser.java


示例20: Max3DSParser

import rajawali.renderer.RajawaliRenderer; //导入依赖的package包/类
public Max3DSParser(RajawaliRenderer renderer, int resourceID) {
    super(renderer.getContext().getResources(), renderer.getTextureManager(), resourceID);
}
 
开发者ID:BitMastro,项目名称:PortalLW,代码行数:4,代码来源:Max3DSParser.java



注:本文中的rajawali.renderer.RajawaliRenderer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Toast类代码示例发布时间:2022-05-23
下一篇:
Java CacheReportRequestProto类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap