Post Your Irrlicht Screenshots / Render Here.
Anyway, the tree model is here, free to anyone who feels like using it. I'll use that to learn leaf shader soon.
https://sourceforge.net/project/showfil ... _id=637269
https://sourceforge.net/project/showfil ... _id=637269
-
- Posts: 168
- Joined: Sun Feb 04, 2007 3:30 pm
- Location: France
Yep, frame, wall and floor are there. Though I need to add static objects that have physics in them later. Plus more RenderMonkey shader code will be added in there as well. Looking forward to the fabric shader and the garage with a shiny car in there, that one will demo environment mapping.
Here's the model in Blender...
Code: Select all
video::ITexture* colorMapRock = driver->getTexture("../../media/rockwall.bmp");
video::ITexture* normalMapRock = driver->getTexture("../../media/rockwall_height.bmp");
video::ITexture* colorMapBrick = driver->getTexture("../../media/brick01.dds");
video::ITexture* normalMapBrick = driver->getTexture("../../media/brick01Bump.bmp");
video::ITexture* colorMap = driver->getTexture("../../media/floor_wood_3light.dds");
video::ITexture* colorMap2 = driver->getTexture("../../media/floor_wood_3.dds");
video::ITexture* normalMap = driver->getTexture("../../media/floor_wood_3Bump.bmp");
driver->makeNormalMapTexture(normalMap, 9.0f);
driver->makeNormalMapTexture(normalMapRock, 9.0f);
driver->makeNormalMapTexture(normalMapBrick, 9.0f);
scene::IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(
roomMesh->getMesh(0));
room = smgr->addMeshSceneNode(tangentMesh);
if (true)
{
irr::video::SMaterial m1;
m1 = room->getMaterial(0);
room->getMaterial(0).setTexture(0, colorMapBrick);
room->getMaterial(0).setTexture(1, normalMapBrick);
room->getMaterial(0).MaterialType = video::EMT_PARALLAX_MAP_SOLID;
room->getMaterial(0).MaterialTypeParam = 0.035f; // adjust height for parallax effect
room->getMaterial(0).SpecularColor.set(0,0,0,0);
room->getMaterial(1).setTexture(0, colorMapWood);
room->getMaterial(1).setTexture(1, normalMapWood);
room->getMaterial(1).MaterialType = video::EMT_PARALLAX_MAP_SOLID;
room->getMaterial(1).MaterialTypeParam = 0.035f; // adjust height for parallax effect
room->getMaterial(1).SpecularColor.set(100,100,100,0);
}
else
{
room->setMaterialTexture(0, colorMapBrick);
room->setMaterialTexture(1, normalMapBrick);
room->setMaterialFlag(video::EMF_FOG_ENABLE, false);
room->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
}
irr::core::vector3df s1(50,50,50);
room->setScale(s1);
Here's the model in Blender...
-
- Posts: 199
- Joined: Wed Nov 29, 2006 4:07 am
-
- Posts: 199
- Joined: Wed Nov 29, 2006 4:07 am
Hey thank you.
Here is the toon shader on the trees. It uses vertex colors for the ambient lighting.
Some unlit grass.
Here is the toon shader on the trees. It uses vertex colors for the ambient lighting.
Code: Select all
// toon tree vertex shader
varying vec4 Color;
varying vec3 Normal;
varying vec3 ViewDirection;
varying vec3 LightDirection;
void main()
{
gl_Position = ftransform();
gl_TexCoord[0] = gl_MultiTexCoord0;
Normal = gl_NormalMatrix * gl_Normal;
vec3 Position = gl_ModelViewMatrix * gl_Vertex;
LightDirection = gl_NormalMatrix * vec3(0.75,1,-0.75);//directional sunlight
ViewDirection = -Position;
Color = gl_Color;
}
Code: Select all
// toon tree pixel shader
varying vec3 Normal;
varying vec3 LightDirection;
varying vec3 ViewDirection;
varying vec4 Color;
void main()
{
vec3 N = normalize(Normal);
vec3 L = normalize(LightDirection);
vec3 E = normalize(ViewDirection);
vec3 R = reflect(-L, N);
float light_angle = max(dot(R,E),0.0);
if (light_angle > 0.01) Color *= 1.5;//diffuse
if (light_angle > 0.9) Color=vec4(1,1,1,1);//specular
float ink_angle = max(dot(N,E),0.0);
if (ink_angle <0.25) Color=vec4(0,0,0,0);//inking
gl_FragColor = Color;
}
Signature? I ain't signin nuthin!
Thats an awesome toonshader. Does it work with anti-alias too?
YASS - Yet another Space Shooter
under Devolpment, see http://yass-engine.de
under Devolpment, see http://yass-engine.de