Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Inspector Coarse

Pages: [1]
1
Graphics / Re: Sfml multi-textured tile map
« on: August 17, 2015, 05:08:15 pm »
All i need to do is sample the same texture at at-least four different points, so using an offset will do. Using colour channel that gives me 4 different values(uint8 so 0-255) for weights so, four textures.

Tex2pos will be Tex1pos + offset of some kind. etc.


pixel = Tex1Pos * TexWeight.x
pixel += Tex2 Pos * TexWeight.y
...     +=
...     +=


 Is this possible?
 

The tile map will appear smoothly textured as a result, with textures painted according to the weight values which could be a heightmap or any old map.



2
Graphics / Re: Sfml multi-textured tile map
« on: August 17, 2015, 02:54:49 pm »
So that the overlaying textures blend to produce the multi texture effect ?


I was planning on doing it in the shader, hence that line of code which is from a basic texturing pixel shader.
I just don't know how to go about accessing different parts of the texture(atlas) to draw the right part according to the weight information.

3
Graphics / Sfml multi-textured tile map
« on: August 17, 2015, 02:40:33 pm »
How would i do multi texturing in sfml?

Since sf::vertex is set, i would have to use the colour channel to carry the texture weights, and then all i need to do is specify the uv somehow to sample the appropriate texture from the texture 'atlas'.
How would/could i do that?

I don't quite understand "gl_TexCoord[0]" here.

Quote
vec4 pixel = texture2D(mapTexture, gl_TexCoord[0].xy);





Any help appreciated.

4
Graphics / Vertex Arrays - Dynamic?
« on: July 09, 2015, 05:18:51 pm »
In dx we have static buffers and dynamic buffers. If you want to make per frame updates to the verts you'd go with the dynamic, is this how it is done with sfml/opengl? I want to reduce draw calls as much as possible and dynamic buffers for the geometry would rock.

Pages: [1]
anything