rendering cube lighter than original texture color

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
vroad
Posts: 18
Joined: Sun Jan 03, 2010 1:30 pm

rendering cube lighter than original texture color

Post by vroad »

I would like to rendering a cube with a texture that is brighter than original texture color.
I disabled lighting, but There is no method to render polygons brighter without lighting.
I have considered copy the texture and make it brighter, but it's not useful.
Is there a solution???

Code: Select all

ISceneNode* node = smgr->addCubeSceneNode();
node->setMaterialTexture(0, texture);
node->setMaterialFlag(EMF_LIGHTING, false)
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

Use a pixel shader to multiply the color values of each pixel. It's way faster than any copying you'd do CPU-side as well.

http://www.irrlicht3d.org/pivot/entry.php?id=160
vroad
Posts: 18
Joined: Sun Jan 03, 2010 1:30 pm

Post by vroad »

Thank you for reply.
However, Pixel Shader only works on Direct3D/OpenGL and modern graphics card.
I will implement by it if there are no other methods.
ArakisTheKitsune
Posts: 73
Joined: Sat Jun 27, 2009 6:52 am

Post by ArakisTheKitsune »

Will emissive color do the trick?

Code: Select all

node->getMaterial(i).EmissiveColor.set(0, 255, 255, 255);
where is i index of material that you want to change.
Knowledge is power, understanding is wisdom.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

vroad wrote:Thank you for reply.
However, Pixel Shader only works on Direct3D/OpenGL and modern graphics card.
I will implement by it if there are no other methods.
DirectX 8 is nearly 10 years old. A pixel shader that just brightens the color could be done with it and Shader Model 1.1. Are you really trying to support computers over 10 years old? You don't need a discrete graphics card to run shaders. Integrated chipsets will handle them just fine, especially if they're that simple.
xDan
Competition winner
Posts: 673
Joined: Thu Mar 30, 2006 1:23 pm
Location: UK
Contact:

Post by xDan »

My netbook doesn't have any pixel shader support.

You could render it twice, the second time with the EMT_TRANSPARENT_ADD_COLOR material.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post by slavik262 »

If the texture is going to stay at a constant brightness, you could lock it, step up each pixel, and then unlock it before you started rendering.
Post Reply