Finally, a DirectX 10 video driver for Irrlicht

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Cool. I hope this gets into the Irrlicht core. DirectX11 is what I really want to use.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
evandromillian
Posts: 40
Joined: Wed Apr 01, 2009 11:45 am
Location: São Paulo - Brazil

Post by evandromillian »

Hi people.

New changes to this project:

- Implemented hardware buffers, created by IVideoDriver. Buffers can be created by DirectX 9 and 11 drivers, and draw using it is only enabled for DX 11. See drawHardwareBuffer and createHardwareBuffer methods

- Vertex declaration support started by registerVertexType method, that receives and array of vertex elements and returns and E_VERTEX_TYPE id (same way of shader materials). I decided to only expose an id, and let video drivers to implement in better way. DX 11 implements with vertex declaration class, but DX 9 can store FVF ids or can use DX 9 vertex declaration too (enabling instancing)

- The texture and render target creation methods now supports texture array and multisampling config, as well as a method to query multisample capabilities for video driver. See queryMultisampleLevels and addRenderTargetTexture methods

I'm working now in stream output support. I hope to finish soon.
Next generation for Irrlicht!!!!!
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Are you going to provide binary packages anytime?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
evandromillian
Posts: 40
Joined: Wed Apr 01, 2009 11:45 am
Location: São Paulo - Brazil

Post by evandromillian »

Hi 3DModelerMan,

See in bin/Win32-VisualStudio folder of project. There are the examples and the Irrlicht.dll also. But it was compiled in debug mode, OK?

Contact me in case of doubt.
Next generation for Irrlicht!!!!!
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Alright, thanks.Debug mode is fine for now anyways.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

evandromillian wrote:Hi people.

New changes to this project:

- Implemented hardware buffers, created by IVideoDriver. Buffers can be created by DirectX 9 and 11 drivers, and draw using it is only enabled for DX 11. See drawHardwareBuffer and createHardwareBuffer methods

- Vertex declaration support started by registerVertexType method, that receives and array of vertex elements and returns and E_VERTEX_TYPE id (same way of shader materials). I decided to only expose an id, and let video drivers to implement in better way. DX 11 implements with vertex declaration class, but DX 9 can store FVF ids or can use DX 9 vertex declaration too (enabling instancing)

- The texture and render target creation methods now supports texture array and multisampling config, as well as a method to query multisample capabilities for video driver. See queryMultisampleLevels and addRenderTargetTexture methods

I'm working now in stream output support. I hope to finish soon.
That multisample bit sounds extremely great :) And the solution for the flexible vertices is quite remarkable too. Good job!
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
evandromillian
Posts: 40
Joined: Wed Apr 01, 2009 11:45 am
Location: São Paulo - Brazil

Post by evandromillian »

Thanks Mel.

Ths is an example of how to create custom vertex types:

Code: Select all

struct ParticleVertex {
   core::vector3df Pos;
   core::vector3df Velocity;
   u32 Type;
};

core::array<SVertexElement> elements;
elements.push_back(SVertexElement(EVES_POSITION, EVET_FLOAT3, 0))
elements.push_back(SVertexElement(EVES_NORMAL, EVET_FLOAT3, 0))
elements.push_back(SVertexElement(EVES_TEXTURE_COORD, EVET_UINT1, 0))
E_VERTEX_TYPE particleType = driver->registerVertexType(elements);

So, in draw methods, you can use this vertex type:

Code: Select all

drawVertexPrimitiveList(0, vertexCount, 0, indexCount/3, particleType, scene::EPT_TRIANGLES, indexType);
Next generation for Irrlicht!!!!!
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Does this allow passing extra per-vertex information into shaders?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Could you point me to the AA code in the RTT generation? I did only find the feature support check for various AA modes, but no way to make an RTT anti-aliased or not. This was something which I wanted to approach for 1.8 or 1.9
evandromillian
Posts: 40
Joined: Wed Apr 01, 2009 11:45 am
Location: São Paulo - Brazil

Post by evandromillian »

Hybrid,

I think that I didn't upload this implementation yet, sorry :lol:

I changed the method for addRenderTargetTexture, that now is:

Code: Select all

virtual ITexture* addRenderTargetTexture(const core::dimension2d<u32>& size,
				const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN,
				u32 sampleCount = 1, u32 sampleQuality = 0, u32 arraySlices = 1) =0;
And I removed the check for types of AA, because is implementation dependant. I don't know if is a good idea, cause DX9 handle this diferently from DX11 and from OpenGL.

3DModelerMan,

This allow not only passing extra information, but create a new type of vertex you need. But I keep this simple too, only exposing one method, the SVertexElement struct and returning a simple and well known E_VERTEX_TYPE enumeration.


But I just implemented this features for DX 11 driver for now, OK?

The repository is now updated, sorry for the delay. :D
Next generation for Irrlicht!!!!!
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

@Hybrid
Will you be integrating this with Irrlicht core soon?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

3DModelerMan wrote:@Hybrid
Will you be integrating this with Irrlicht core soon?
This means...?
The whole add-on? No, support for the new features are still WIP, needs better integration etc.
Just the AA feature? No, I will take a different approach.
Just the driver without the additional features? Depends on how complete it is, and how much additional changes in the basic engine it needs. the ogl-es 2.x driver is a good example for a real add-on (so far only in ogl-es branch). It just adds new files, a few changes to add the create functions and enum values, and exactly one change in the existing engine API.
evandromillian
Posts: 40
Joined: Wed Apr 01, 2009 11:45 am
Location: São Paulo - Brazil

Post by evandromillian »

Hybrid,

How do you think to integrate AA?I thought about using something like:

Code: Select all

driver->setTextureCreationFlag(video::ETCF_MSAA_8X, true);
// create texture
driver->setTextureCreationFlag(video::ETCF_MSAA_8X, false);
But I don't think that is good, cause MSAA only makes sense in render target texture.

I think that DX 11 driver is about 70% complete. But none of this features are strict necessary to this driver be delivered. I will do my best to integrate it without changes in the main engine interface.

But there is no doubt that these changes will be useful to use this new driver (and the others too) to release full potential.

Let's negociate this changes, I would be very happy to help.
Next generation for Irrlicht!!!!!
amerthebest
Posts: 2
Joined: Thu Nov 30, 2006 10:57 am

Post by amerthebest »

I think directx 11 support is very nice feature,i've tested it and it works well at moment with some leaks on 2d rendering,shadows and particle system.

There is small bug into the CD3D11Driver::queryMultisampleLevels(ECOLOR_FORMAT format, u32 numSamples) methods,you're always passing 4 instead of numSamples, should be:

Code: Select all

u32 CD3D11Driver::queryMultisampleLevels(ECOLOR_FORMAT format, u32 numSamples) const
{
	UINT quality = 0;
	if (SUCCEEDED(Device->CheckMultisampleQualityLevels(this->getD3DFormatFromColorFormat(format),
														numSamples, &quality)))
	{
		return quality;
	}

	return 0;
}

Anyway,nice work.

Keep you're work.
fmx

Post by fmx »

Great work there evandromillian

You should post about your Flexible Vertex Format scheme in Nadro's topic:
http://irrlicht.sourceforge.net/phpBB2/ ... 57&start=0

Even if FVFs will not be implemented into the rest of irrlicht for a long while yet, its never too early to discuss implementation strategies
Post Reply