• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
??????? ?????

How to make quare tiles look less squarish?

5 posts in this topic

I am making a terrain for my game and it uses tiledata(a grid of squares and the terrain type of each square),but it looks very squarish,even when I try to blur it on the blendmap:

[attachment=9041:terrain.png]

Is there a way to make the tiles be some other shape than a square?At most I managed to make them a little more circlish,using trigonometric functions,but all those operations just for the terrain diffuse color......
0

Share this post


Link to post
Share on other sites
Had the same problem with my terrain generator. Got awesome results with texture blending:

Render all textures on every polygon.
For each texture on each vertex, assign an alpha value. (Render multiple textures over each other)

The tricky part:
For a given vertex compute all textures around it (four squares touching the vertex).
The alpha value should be the weighted average of the materials.

Example:
Givven a quad of Grass (G) and Rock( R ) Snow(S) in the following formation:
GG
RG

The vertex in the middle should have 0.75 grass , 0.25 rock, and no snow.



Hope this helps. Edited by SillyCow
1

Share this post


Link to post
Share on other sites
[quote name='SillyCow' timestamp='1338070893' post='4943575']
Had the same problem with my terrain generator. Got awesome results with texture blending:

Render all textures on every polygon.
For each texture on each vertex, assign an alpha value. (Render multiple textures over each other)

The tricky part:
For a given vertex compute all textures around it (four squares touching the vertex).
The alpha value should be the weighted average of the materials.

Example:
Givven a quad of Grass (G) and Rock( R ) Snow(S) in the following formation:
GG
RG

The vertex in the middle should have 0.75 grass , 0.25 rock, and no snow.

[img]https://21c6c5d3-a-62cb3a1a-s-sites.googlegroups.com/site/eylgames/quest/quest.jpg?attachauth=ANoY7comBj8eeAd7gu5gMylmUbykjkPpaguVIpmBiT9zWxrvI97qZgPkYp-o1_imRyzPL3AoP0wDkgQjTBwHLUxbJHuCPTDKiiQMkQJAyVnyMa9B4mB03oXpn3IYypQyTiwENJHXKTzvGX_MZ7U-v01MxtYPjV7MPxhogqiNIBx7bzGW7SysANrn9wJvqBuBFIi4Bqshkjd4xP2PQcmuAZyf_ND8PBrP6A%3D%3D&attredirects=0[/img]

Hope this helps.
[/quote][quote name='SillyCow' timestamp='1338070893' post='4943575']
Had the same problem with my terrain generator. Got awesome results with texture blending:

Render all textures on every polygon.
For each texture on each vertex, assign an alpha value. (Render multiple textures over each other)

The tricky part:
For a given vertex compute all textures around it (four squares touching the vertex).
The alpha value should be the weighted average of the materials.

Example:
Givven a quad of Grass (G) and Rock( R ) Snow(S) in the following formation:
GG
RG

The vertex in the middle should have 0.75 grass , 0.25 rock, and no snow.

[img]https://21c6c5d3-a-62cb3a1a-s-sites.googlegroups.com/site/eylgames/quest/quest.jpg?attachauth=ANoY7comBj8eeAd7gu5gMylmUbykjkPpaguVIpmBiT9zWxrvI97qZgPkYp-o1_imRyzPL3AoP0wDkgQjTBwHLUxbJHuCPTDKiiQMkQJAyVnyMa9B4mB03oXpn3IYypQyTiwENJHXKTzvGX_MZ7U-v01MxtYPjV7MPxhogqiNIBx7bzGW7SysANrn9wJvqBuBFIi4Bqshkjd4xP2PQcmuAZyf_ND8PBrP6A%3D%3D&attredirects=0[/img]

Hope this helps.
[/quote]

wait I'm kind of confused,isn't the blending done in [b]pixel [/b]shader?You mentioned [b]vertex[/b].I might have not understood properly,the image you linked is not displaying for some reason
0

Share this post


Link to post
Share on other sites
Actually did this way before shader languages. I think it was with DirectX7 on a Geforce 2. So it was good old fixed pipeline (No shaders... ) . It doesn't matter. I had square terrain tiles (Easy for calculations) , and needed to remove the ugly square effect for rendering.

Fact of the matter is that for rendering it is better to assign material to vertex then to assign to square.

When you render a triangle, render it several times with different textures (fixed pipeline). Or render it once with several textures (HLSL pixel shader). The outcome is the same.

[quote]
[left][background=rgb(250, 251, 252)]Example:[/background][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]Givven a quad of Grass (G) and Rock( R ) Snow(S) in the following formation:[/background][/size][/font][/color][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]GG[/background][/size][/font][/color][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]RG[/background][/size][/font][/color][/left]

[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(247, 247, 247)]The vertex in the middle should have 0.75 grass , 0.25 rock, and no snow.[/background][/size][/font][/color][/left]

[/quote]

Use the above mentioned "algorithm" to calculate the alpha value for that vertex and texture

Here is an example of the result. Although terrain tiles are square, you cannot see them (besides the fact that I used a very repetitive texture here). Edited by SillyCow
0

Share this post


Link to post
Share on other sites
[quote name='SillyCow' timestamp='1338073529' post='4943582']
Actually did this way before shader languages. I think it was with DirectX7 on a Geforce 2. So it was good old fixed pipeline (No shaders... ) . It doesn't matter. I had square terrain tiles (Easy for calculations) , and needed to remove the ugly square effect for rendering.

Fact of the matter is that for rendering it is better to assign material to vertex then to assign to square.

When you render a triangle, render it several times with different textures (fixed pipeline). Or render it once with several textures (HLSL pixel shader). The outcome is the same.

[quote]
[left][background=rgb(250, 251, 252)]Example:[/background][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]Givven a quad of Grass (G) and Rock( R ) Snow(S) in the following formation:[/background][/size][/font][/color][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]GG[/background][/size][/font][/color][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]RG[/background][/size][/font][/color][/left]

[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(247, 247, 247)]The vertex in the middle should have 0.75 grass , 0.25 rock, and no snow.[/background][/size][/font][/color][/left]

[/quote]

Use the above mentioned "algorithm" to calculate the alpha value for that vertex and texture

Here is an example of the result. Although terrain tiles are square, you cannot see them (besides the fact that I used a very repetitive texture here).
[/quote]

[quote name='SillyCow' timestamp='1338073529' post='4943582']
Actually did this way before shader languages. I think it was with DirectX7 on a Geforce 2. So it was good old fixed pipeline (No shaders... ) . It doesn't matter. I had square terrain tiles (Easy for calculations) , and needed to remove the ugly square effect for rendering.

Fact of the matter is that for rendering it is better to assign material to vertex then to assign to square.

When you render a triangle, render it several times with different textures (fixed pipeline). Or render it once with several textures (HLSL pixel shader). The outcome is the same.

[quote]
[left][background=rgb(250, 251, 252)]Example:[/background][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]Givven a quad of Grass (G) and Rock( R ) Snow(S) in the following formation:[/background][/size][/font][/color][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]GG[/background][/size][/font][/color][/left]
[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(250, 251, 252)]RG[/background][/size][/font][/color][/left]

[left][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][background=rgb(247, 247, 247)]The vertex in the middle should have 0.75 grass , 0.25 rock, and no snow.[/background][/size][/font][/color][/left]

[/quote]

Use the above mentioned "algorithm" to calculate the alpha value for that vertex and texture

Here is an example of the result. Although terrain tiles are square, you cannot see them (besides the fact that I used a very repetitive texture here).
[/quote]


[left]ok just one last question - can you post a single-line example of ''setting the vertex to 0.75 grass''? I mean I'm new with HLSL and so far all I've done is the standart RGB blendmap with 3 textures in pixel shader. [/left]
0

Share this post


Link to post
Share on other sites
It'd be something like this (I'd personally do it in a pixel shader, as then you can perturb the boundaries with some noise to make it more natural and give you even more detail):

[CODE]float rockPercentage = 0.25 //amount to go for rock
float grassPercentage = 0.75 //amount to go for grass
float snowPercentage = 0 //amount to go for snow

float4 snow = snowTex.Sample(texcoords); //the pixel colour of the snow texture
float4 grass = grassTex.Sample(texcoords); //the pixel colour of the grass texture
float4 rock = rockTex.Sample(texcoords); // the pixel colour of the rock texture

float4 colour = snow * snowPercentage + rock * rockPercentage + grass * grassPercentage;[/CODE]

Then the pixel colour will be 0% snow, 25% rock and 75% grass.

Do the same with the normal maps for a nice blend of those too.

EDIT: commented it up Edited by NickUdell
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0