Texture index and mask

Blitz3D Forums/Blitz3D Programming/Texture index and mask

Naughty Alien(Posted 2008) [#1]
..well..here it is, if i do this

ElementTex=LoadTexture(Tex$,4)
EntityTexture ElementID,ElementTex,0,0

its all working fine and my texture is properly masked so grass looking nice..now if i do this

ElementTex=LoadTexture(Tex$,4)
EntityTexture ElementID,ElementTex,0,1

Masking doesnt work anymore..texture is assigned but mask area is black..am I missing something, or I have to set something additionaly in order to use masked texture on other tex index than 0 ??


Ross C(Posted 2008) [#2]
Doesn't the texture need a texture below to blend to, if the 0 slot is empty?


Naughty Alien(Posted 2008) [#3]
well..why is it working on slot 0 if there is nothing under 0?? I mean, I just want to know eventually whats going on...


Ross C(Posted 2008) [#4]
DOesn't slot 0 belnd to the vertex color of the triangle though? I'm not 100% sure whats happening, but try putting just a plain white texture on slot 0 and see what happens.

Any reason why you can't use slot 0?

Just as a side note, i've heard cubemaps on certain blend modes don't work unless they are in slot 0.


Naughty Alien(Posted 2008) [#5]
..im messing with multiple blending modes including Normalmapping blended over lightmap, so its looking really high detailed without incorporating any dynamic light..so suddenly I realized that if i do masking on slot 1, everythings fine except masking area is black..same goes to alpha..so i was wondering whats going on..


markcw(Posted 2008) [#6]
I'm not sure if masking works with blended textures. Maybe you've to use alpha.


Ross C(Posted 2008) [#7]
It recommends not using alpha textures. However, in projects i've done before, masking works perfect when blending. Do you have a cubemap thrown in there somewhere? Do you have media we could test?


John Blackledge(Posted 2008) [#8]
Just to add to your info, this is what I've found works best for layers on Blitz Terrains; might work on mesh terrains as well:

;Layer 0 'Under' map ; Mark's Rock.bmp, texture scaled x 10 to 'breakup' the colourmap
EntityTexture Terr\hEnt, Terr\hUmap, 0, 0

;Layer 1 Colourmap ; covers whole terrain, texture scaled to terrainsize()
EntityTexture Terr\hEnt, Terr\hCmap, 0, 1

;Layer 2 Lightmap ; covers whole terrain, texture scaled to terrainsize()
EntityTexture Terr\hEnt, Terr\hLmap, 0, 2