Multitextureing fixed/shader?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
ThommyE
Posts: 48
Joined: Sun Sep 18, 2005 3:02 pm
Location: germany/badnerlaendle

Multitextureing fixed/shader?

Post by ThommyE »

hi all,

i just wondered what coding efforts one would have to make to get more textures per material.
most graficcards support 8 textures per pass or at least 4 (if i remember this one right ) so (i imagine) it shouldn't be that hard to get 4 textures into irrlicht materials.
are shaders also limited to the irrlicht materials? i guess not.. (but since shaders aren't available on all cards i'd think using buildin stuff would be preferable)

if anyone could tell me about the effordts one would have to take to get 4 or 8 textures per material working (with open-gl)?

my reason for asking is that 2 more textures can already improve image quality pretty much without hitting performance too hard.
main advantages would be:
-geometry of all kinds: Color-,Light-,Specular-,Bumbmap
where specular greatly improves surface realism and bumbmap surface structure (i know normalmap is already in). espeacially spec-maps improves image quality while not eating too much power.
-terrains. more textures would allow propper multitexuring and blending (well i know about spin(t?)z & his terrain... but not exactly what i had in mind.

so anyone who could give me a feedback about how much code would have to be changed?

greetings
thommy e

ps: this is not a feature request, just mere information... but if anyone wants to do it^^
athlon2400xp+,geforce4200ti, 0.2Tb hd+64mb extern, 512mb ram, linux FC5 2.6.16-1.2096, 100%gates-free system
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The code to support 4 textures in the video driver is pretty minimal. Most changes are to SMaterial and the video drivers. The next version of Irrlicht is supposed to support 4 units, so if you're willing to wait...
ThommyE
Posts: 48
Joined: Sun Sep 18, 2005 3:02 pm
Location: germany/badnerlaendle

Post by ThommyE »

thx for the info=)
thats the way to go.. thought 8 textures would be even better ;)
i'll just sit back, relax and care about other problems till 4 textures are available.

greetings
thomas e
athlon2400xp+,geforce4200ti, 0.2Tb hd+64mb extern, 512mb ram, linux FC5 2.6.16-1.2096, 100%gates-free system
needforhint
Posts: 322
Joined: Tue Aug 30, 2005 10:34 am
Location: slovakia

Post by needforhint »

what do you want to do with 8 parallel textures on eachother? :shock:
what is this thing...
elander
Posts: 193
Joined: Tue Oct 05, 2004 11:37 am

Post by elander »

A much more cool solution would be to load material specs from Collada files. There is already some support for Collada in Irrlicht. This could be used to load any material spec you want (within hardware limits of course). Plus you don't even need to write these materials specs by as FXcomposer and and RenderMonkey are already capable of exporting to this format.
Anteater
Posts: 266
Joined: Thu Jun 01, 2006 4:02 pm
Location: Earth
Contact:

Post by Anteater »

You can do some neat stuff with 8 textures. Alot of special FX.
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

A much more cool solution would be to load material specs from Collada files. There is already some support for Collada in Irrlicht. This could be used to load any material spec you want (within hardware limits of course). Plus you don't even need to write these materials specs by as FXcomposer and and RenderMonkey are already capable of exporting to this format.
Number1
sigh... if only if it was that easy.

Shader ussually are very code dependant as you need cutom classes/managers to actually feed them information to make them do anything useful. how good is a phong shader if u dont implement it properly with your lighting system?

number two .fx isnt a standard convention format, its just an organised textfile so what if you had multiple passes? diffrent programs would export them in diffrent ways.

anyway multiple passes are pretty much process depended and can be achieved in many ways, postprocessor or GLBLEND etcc... so shaders in general are not plug and play, pretty much like most c++ code

Number 2
where specular greatly improves surface realism and bumbmap surface structure (i know normalmap is already in). espeacially spec-maps improves image quality while not eating too much power.
-terrains. more textures would allow propper multitexuring and blending (well i know about spin(t?)z & his terrain... but not exactly what i had in mind.
I have already written auomatic terrain splatters and a specularity generator/renderer shader, i hope to realease it soon but it might take longer if Emil halims's lib works on ati bc i would have to convert my stuff to his lib so it has greater compatibility.

anyway i have a patch that allow 8 textures per polygon in opengl and most new cards suppourt 16, i dont see what kind of effects would use more than 4 textures. :D
ThommyE
Posts: 48
Joined: Sun Sep 18, 2005 3:02 pm
Location: germany/badnerlaendle

Post by ThommyE »

needforhint wrote:what do you want to do with 8 parallel textures on eachother? :shock:
for starters... terrain=)
with 4 textures it's already hard to get a decent terrain. allows you to use only 2 real textures per terrain if you store the opacy in a seperate texture(with no lightmaps).
using 8 you can use 3 textures, a lightmap (not so important but when it comes to shadows cast from objekts sometimes useful), and you still have 1 free texture chanel to use... to simulate cloud-shadows or things like that.
add a few specular and bumbmaps and you have already 14 textures...

for normal levels and model 4 textures are already great.
color;spec;normal;lightmap and you can get great results
omaremad wrote: I have already written auomatic terrain splatters and a specularity generator/renderer shader, i hope to realease it soon but it might take longer if Emil halims's lib works on ati bc i would have to convert my stuff to his lib so it has greater compatibility.
jeah.. splitting terrain is one solution but if you already are using splitted and quite huge terrains you will get awfully lot of terrain pieces^^. beside one would need a propper terrain-node which not only puts together the pieces but also optimises them again... and thats where you'll run into trouble (without shaders).
well nothing against shaders for terrain. vertexshaders are very usefull if it comes to terrain otimization, can be used for geomorphing and such nice stuff without hitting the performance.
but i have no idea if shader or fixed-in multitexturing is faster (well speed is not everything...)
how about a addon for irredit? editing of streamed and non-streamed terrain, generic infinite-terrain genereation ,texture-painting,auto-tile generation,material editor (maybe with auto shader creation) and so on would be a very nice thing... using normal-values and altitude to calculate the opacity maps for textures,grass-node's and such... but thats not part of this thread :D... wouldn't be that hard, would it ;).. i bet there would be mmorpg popping out of the nowhere^^
somewhat terragen like... just realtime and not so realism-tuned^^
i really should stop talking to myself

i'm just hopeing for 4 or 8 textures and/or shaders for this.(would still prefer up to 8 textures without shaders)
athlon2400xp+,geforce4200ti, 0.2Tb hd+64mb extern, 512mb ram, linux FC5 2.6.16-1.2096, 100%gates-free system
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

"splatting" is not splitting :evil:

splatting is distributing textures according to certain rules
elander
Posts: 193
Joined: Tue Oct 05, 2004 11:37 am

Post by elander »

omaremad wrote:so shaders in general are not plug and play, pretty much like most c++ code
Yes i know that, but perhaps a program to read a Collada spec and generate the C++ source for the material for people who are not experts in this subject. That way people would bug you less. ;)
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

True but.... shaders are limit less, whta if the shader require the cpu to send to it the sine of the time or what if the shader integrates with other sahders(multiple passes) or what if render targets are needed? creating such a plugin would be useless as The ready made shaders out there still have diffrent c++ implementations
elander
Posts: 193
Joined: Tue Oct 05, 2004 11:37 am

Post by elander »

This would help a people a lot making more flexible materials for Irrlicht. Besides a collada translator to C++ another idea could be a app with a simple gui where the user could choose how many textures the material would support and how to blend each texture. It would be simple to generate a material this way.

Ok but that is not possible because Irrlicht doesn't support more than 2 textures per material i guess, but how hard would it be to change the engine to support 8 textures per material? This would certainly be put to a good use.

ThommyE just mentioned some good examples. 4 textures per material (diffuse,spec,normal,lightmap) is becoming the norm and for terrain or detail maps this can go over the 4 texture limit easly. The only disadvantage is for people using old graphics cards who would be penalized.
ThommyE
Posts: 48
Joined: Sun Sep 18, 2005 3:02 pm
Location: germany/badnerlaendle

Post by ThommyE »

"splatting" is not splitting Evil or Very Mad
sorry about that one^^
The only disadvantage is for people using old graphics cards who would be penalized.
thought the card-specs say 8 textures per pass... wouldn't they just need to render an extra path? (ok thats really not a nice way to solve problems but they will see something.. and even if it's a still-live of a realtime app)

i'm also for a small material-generator with preview. maybe someone could add it to the meshviewer example?(once 4 textures are supported, what seems to be in near future)
athlon2400xp+,geforce4200ti, 0.2Tb hd+64mb extern, 512mb ram, linux FC5 2.6.16-1.2096, 100%gates-free system
Post Reply