Could you use this for day/night maps?
That would be sweet for mods (a.k.a. CA

Moderator: Moderators
More detailed maps, allow using alpha channels in the map texture, maybe even reflective map textures.Aztek wrote:What exactly could this do?
Maybe, generating a random map texture wouldn't be a big problem,Aztek wrote:random map generator
url_00 wrote:Could you use this for day/night maps?
The fourth channel of an image, like:Aztek wrote:
Ok what's an alpha channel?
It already does, Spring.SetDrawGround(false)Argh wrote:And is there any way to shut off the standard map renderer
At 32x32 or 16x16 it as fast as the standard map renderer, but performance has been tested quite few times.Argh wrote:so that speed's comparable?
Code: Select all
gl.Color(r3,g3,b3,a3)
gl.Normal(Spring.GetGroundNormal(xx+d,zz+d))
gl.Vertex(xx+d,H(xx+d,zz+d,d*0.5),zz+d)
if (tiledtex == true) then gl.TexCoord(0,1)
elseif (tiledtex == false) then gl.TexCoord(x/(mx/d),(y+1)/(mz/d)) end
gl.Color(r2,g2,b2,a2)
gl.Normal(Spring.GetGroundNormal(xx ,zz+d))
gl.Vertex(xx,H(xx,zz+d,d*0.5),zz+d)
if (tiledtex == true) then gl.TexCoord(0,0)
elseif (tiledtex == false) then gl.TexCoord(x/(mx/d),y/(mz/d)) end
gl.Color(r1,g1,b1,a1)
gl.Normal(Spring.GetGroundNormal(xx ,zz ))
gl.Vertex(xx,H(xx,zz,d*0.5),zz)
if (tiledtex == true) then gl.TexCoord(1,0)
elseif (tiledtex == false) then gl.TexCoord((x+1)/(mx/d),y/(mz/d)) end
gl.Color(r4,g4,b4,a4)
gl.Normal(Spring.GetGroundNormal(xx+d,zz ))
gl.Vertex(xx+d,H(xx+d,zz,d*0.5),zz)
if (tiledtex == true) then gl.TexCoord(1,1)
elseif (tiledtex == false) then gl.TexCoord((x+1)/(mx/d),(y+1)/(mz/d)) end
A bit presumptious for what the fix amounts to (specifiying the texcoorsAlso, I'd like those whom don't fully understand the fix to refrain from making posts in that thread until understanding, even if that takes long while)
I wouldn't say that if fix was complicated. (T.B.H. I'm sick of especially Argh's comments on this forum. Not hard to predict that coz i basically said that LUA map drawer is bad idea, a lot of ppl gonna jump in)Kloot wrote:A bit presumptious for what the fix amounts toAlso, I'd like those whom don't fully understand the fix to refrain from making posts in that thread until understanding, even if that takes long while)
Naw, you also didn't see the real bug in the code(specifiying the texcoors
in non-tiled mode in the same order as the vertices), don't you think?
For me it is still playable at 16x16 detail.This script is drastically slower than spring's map rendering (for me), even though spring does lot more stuff with maps.
Probably it is, because lua is much slower, and it lacks many useful features.LUA map drawer is bad idea
well the real bug is that you need to set all vertex properties (including glTexCoord) before call to glVertex . This code called glTexCoord after glVertex , specifying the texture coordinate of entirely different vertex.Kloot wrote:I meant that the corners of the quad were out of phase with the
texcoords, bottom-right vertex mapping to bottom-left TC etc. It
just seemed like a strange thing to say "stay out unless you get
this".