New Fixed shaders proposal.

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

New Fixed shaders proposal.

Post by Mel »

Hello! I've been thinking a bit about this matter, and i think it would be cool that Irrlicht, besides all the great fixed functions it already has, added two new functions, if possible.

They'd don't need special vertex features, just the plain system which already allows the sphericalmapping would be enough.

My propositions are:

MASKED 2 LAYER REFLECTION.
and
TRANSPARENT ALPHACH 2LAYER REFLECTION.

MASKED 2 LAYER REFLECTION: The usage if this function would be as follow: You have two textures, one of them is the base, diffuse texture, which has an alpha channel, and the other is a reflection map. The result of the texture would be the basic diffuse, blended or added with the reflection map where the alpha channel was opaque. That way, surfaces would have pixels where the texture is simply the diffuse map, and other parts where it also has a reflection map added.

TRANSPARENT ALPHACH 2LAYER REFLECTION: is the same as before, but taking in consideration the alpha channel of the difuse texture layer INSTEAD of the vertices alpha channel, which is what irrlicht uses by default. That would give surfaces with transparent parts, and other parts which would also have a reflection added.

What do you think?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Possibly related, I made a patch for fixed function projective texturing ages ago, with these 3 materials:

EMT_PROJECTIVE_SOLID, EMT_PROJECTIVE_DETAIL, and EMT_PROJECTIVE_REFLECT

The first 2 work like solid and detail but have an add-signed layer of projective texturing controlled by the texture matrix of that texture layer. The last one is a transparent material that projects a texture from the viewpoint (For planar reflections, eg, water, shiny floor, etc).

These two don't require any shaders, I think it's been long enough so I'll post the patch for this soon on the tracker, I've just got to get a few bugs ironed out which might take a while (But I'll probably just put it up with a few bugs in the hopes that someone has the time to fix them).

Anyway Mel, I don't think the devs want to add too many new fixed function materials at this point, as it would be better to just adopt a per-layer strategy in the long run (I'm hoping they are planning something like this for Irrlicht 2.0), and that should allow most of the combinations you suggested out of the box.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

You are very kind. I hope these shaders work like that :) I think i saw the projective one in motion in a demo i found over here.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply