How do you make a 2-sided texture

Blitz3D Forums/Blitz3D Beginners Area/How do you make a 2-sided texture

Polarix(Posted 2016) [#1]
okay that was poorly worded, but you know minecraft? of course you do. I was trying to make a grass block but it ended up looking weird. Any help?





Polarix(Posted 2016) [#2]
http://imgur.com/fqliMdS picture of the texture i tried to use


Guy Fawkes(Posted 2016) [#3]
Use Flipmesh if your Y-Position is below the plane or cube.


RGR(Posted 2016) [#4]
Start with the PaintMesh Example
Replace the brush texture with your own texture. Use cursor keys and z x (or y x) to rotate the block.




Guy Fawkes(Posted 2016) [#5]
NICE one, RGR! :)

~GF


Bobysait(Posted 2016) [#6]
To answer the question "How do you make a 2-sided texture" :

It's the material (ie: the brush) that you apply the texture on, that can be 2-sided, the texture itself is just a bitmap with several parameters to set the matrix (the way the texture will stretch on the surface). There is also a blending parameter, but it just affect the way the texture will blend with the current pixel of the surface being rendered during the RenderWorld.

The "brush" defines the way the material is rendered : the color, the fx (which contains what you're looking for -> Fx & 16 = "disable-backface-culling"), surface blending mode, alpha (opacity), shininess (the "glowsiness" of the surface reflecting the light(s) )


; the texture of the grass
Local tex = LoadTexture("grass.jpg")

; a brush to apply the texture on
Local brush = CreateBrush()
BrushTexture brush, tex
brushFx brush, 16 ; -> disable the backface culling, so the 2 sides of the triangles of the surface this brush is applied on will be visibles.

; an object to apply the texture on
local cube = CreateCube()
PaintEntity cube, brush ; paint the entity with the created brush.



You can also skip the brush creation part and use the entity functions (which does the same thing on the entity's internal brush).
Here it's essentially to understand the difference between a brush and a texture.


Not to mention : I answered the topic title question ... but I don't understand what you're asking on the first post of this topic ...