Post Your Irrlicht Screenshots / Render Here.

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

thanks, i'll be working on a shaded version next. Currently looking on a possible topic which will show a little bit of complexity on light reflection and scatter.
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

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
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Image
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Image
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Image
Image
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Post by Steel Style »

Really cool dlangdev. Why not add decals to make this sound more realistic ?
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

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.

Image

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);

Image

Here's the model in Blender...

Image

Image
Image
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Toon trees

Image
Signature? I ain't signin nuthin!
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

HANDS UP! You will surrender the pretty shader without making a move OR ELSE! Come on! Drop it in the bag!

... wow ... me wanna o-O'
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

that's pretty damned nice oldskoolpunk!
Image Image Image
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Hey thank you.

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;
}
Some unlit grass.

Image
Signature? I ain't signin nuthin!
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

As cute as kittens! I like it. So cheery!
But is it an image compression issue, that the black lines in the distance seem to disappear?
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

No, it's just that the black ink is based on the angle instead of a given width.
MasterD
Posts: 153
Joined: Sun Feb 15, 2004 4:17 pm
Location: Lübeck, Germany
Contact:

Post by MasterD »

Thats an awesome toonshader. Does it work with anti-alias too?
YASS - Yet another Space Shooter
under Devolpment, see http://yass-engine.de
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

crap all crap 8)
Post Reply