Sign in to follow this  
null;

Tile Transition Logic

Recommended Posts

null;    239

How would I go about implementing tile smoothing?

 

Let's say there's a 3x3 set of grass tiles. I want the outside grass tiles to have some kind of outline, while the middle one blends in with the rest.

 

I don't really see a point in sharing any code, as I'm just asking for the implementation process.

 

Thank you to whoever replies!

Share this post


Link to post
Share on other sites
Scouting Ninja    3974
27 minutes ago, null; said:

Let's say there's a 3x3 set of grass tiles. I want the outside grass tiles to have some kind of outline, while the middle one blends in with the rest.

If you mean an outline as in a dark drawn line, then that would probably be done with composition. Some kind of shader that scales the already rendered image, makes in black and renders the original over it.

 

If you meant a outline as in where a ground tile meets a water tile, those tiles are drawn that way, then linked in a tile set.

Share this post


Link to post
Share on other sites
null;    239
15 minutes ago, Scouting Ninja said:

If you mean an outline as in a dark drawn line, then that would probably be done with composition. Some kind of shader that scales the already rendered image, makes in black and renders the original over it.

 

If you meant a outline as in where a ground tile meets a water tile, those tiles are drawn that way, then linked in a tile set.

I think I've thought of a better way of explaining my question, or what I want to accomplish.

How would I incorporate tile smoothing, so the edges aren't always jagged and pointed. Basically, just corner smoothing.

Share this post


Link to post
Share on other sites
null;    239
3 minutes ago, Infinisearch said:

I think the term you want to search for is auto tiles.  I don't know much about there implementation but I think thats the term used to describe your diagram.

That does seem to be the correct search term, thank you.

Share this post


Link to post
Share on other sites
Scouting Ninja    3974

Like I said in my original post they are drawn that way:

You don't have to make one for each tile, however it is normal to make a few because then you can fill a full tile zone with them.

The edges are just smaller partial tiles.

Edited by Scouting Ninja

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  

  • Similar Content

    • By cozzie
      Hi,
      During the journey of creating my 2nd 3D engine, I'm basing quite some of the approaches on the Game Engine Architecture book (Jason Gregory). I've now arrived on the topic: IO.
      In short, the target platforms for me are PC, XBone and PS4.
      With this main assumption I thought of the following logics/ guidelines to follow:
      - I can assume file/folder structures will work on all 3 platforms, when I use '/' as a folder separator
      -- I will define 1 global with the base folder for the application, the rest will 'inherit' from there
      (which can be anything, independent of the 'mount' or drive)
      -- for now I'll create 1 subfolder with data/files that might need write access, so later on I only have to worry about 1 subfolder (settings, configs etc.).
      - file extensions can be longer than 3 characters (in Linux based FreeBSD on PS4)
      - all class members functions needing to load a file, shouldn't have to now about the file structure of the logical application, so they will all take a full filename string including path
      (combining root + subfolder + filename and separators is then the responsibility of the caller/ calling code)
      - some functions will need to be passed a folder, because contents in that folder need to be read OR I can simply define a small list of defined subfolders (under root/ base), because it won't be more then 5 to 10 folders in total (data/shaders, data/textures, data/objects, data/sound etc.)
      My questions:
      - what do you think about this approach?
      - regarding the last point, which of the 2 options would you apply?
      -- option 2 might work fine but feels a bit 'static', not very flexible (on the other hand, would you actually need flexibility here?)
      Any input is appreciated, as always.
    • By RubenRS
      How do i open an image to use it as Texture2D information without D3DX11CreateShaderResourceViewFromFile? And how it works for different formats like (JPG, PNG, BMP, DDS,  etc.)?
      I have an (512 x 512) image with font letters, also i have the position and texcoord of every letter. The main idea is that i want to obtain the image pixel info, use the position and texcoords to create a new texture with one letter and render it. Or am I wrong in something?
    • By MarcusAseth
      this is super strange...
      I have this function here:
      template<typename TFirst, typename... TArgs> bool util::LogConsole(const TFirst& first, const TArgs&... rest) { std::cout << first << " "; return LogConsole(rest...); } bool util::LogConsole() { std::cout << std::endl; return false; } it's recursive, keep printing "first" and recursively sending the rest, until rest is empty and the overload taking no argument is called, which just print a newline. Ignore the bool return.
      Anyway, now I have this code somewhere else:
      for (auto& E : Entities) { float valx = E->GetPosition().x;//return 751 float valy = E->GetPosition().y;//return 838 LogConsole(valx, valy); } Entities is a vector<unique_ptr<Entity>> which currently only contains the derived from Entity player Paddle, so I access the Base class Entity method called GetPosition, which is the center pivot coordinates of the object.
      I pass the variable to LogConsole which predictably prints:
      But not I try to call LogConsole without those 2 variables inbetween, like this:
      for (auto& E : Entities) { LogConsole(E->GetPosition().x, E->GetPosition().y); } and watch what kind of output I get! :
      ... the y value is an unreasonable value o_o
      How is this even possible?! Since only the second value is being affected, my assumption is that there is some weird interplay with the second template parameter, the variadic argument...but I wasn't able to debug it even stepping trough it line by line...can anyone come with an explanation for this really strange behaviour?
    • By MarcusAseth
      Maybe today I'm confused and I'm missing the obvious...
      I've made this simple struct inside my Utility.h 
      template<typename TFirst, typename TSecond> struct Pair { Pair(TFirst f, TSecond s):First{f},Second{s}{} TFirst First; TSecond Second; }; And I'm using it from App.h (which #include "Utility.h") like so:
      App.h
      Pair<Uint32, Uint32> GetWindowSize(); App.cpp
      Pair<Uint32, Uint32> App::GetWindowSize() { return Pair<Uint32, Uint32>(Width,Height); } And I'm getting a cascade of errors ALL on line 39 (image below).
      Any idea what I am doing wrong this time? x_x

       
      EDIT: please mod delete this topic, I just remembered Utility.h put everything inside namespace util, sorry x_x
    • By noodleBowl
      I've gotten to part in my DirectX 11 project where I need to pass the MVP matrices to my vertex shader. And I'm a little lost when it comes to the use of the constant buffer with the vertex shader
      I understand I need to set up the constant buffer just like any other buffer:
      1. Create a buffer description with the D3D11_BIND_CONSTANT_BUFFER flag 2. Map my matrix data into the constant buffer 3. Use VSSetConstantBuffers to actually use the buffer But I get lost at the VertexShader part, how does my vertex shader know to use this constant buffer when we get to the shader side of things
      In the example I'm following I see they have this as their vertex shader, but I don't understand how the shader knows to use the MatrixBuffer cbuffer. They just use the members directly. What if there was multiple cbuffer declarations like the Microsoft documentation says you could have?
      //Inside vertex shader cbuffer MatrixBuffer { matrix worldMatrix; matrix viewMatrix; matrix projectionMatrix; }; struct VertexInputType { float4 position : POSITION; float4 color : COLOR; }; struct PixelInputType { float4 position : SV_POSITION; float4 color : COLOR; }; PixelInputType ColorVertexShader(VertexInputType input) { PixelInputType output; // Change the position vector to be 4 units for proper matrix calculations. input.position.w = 1.0f; // Calculate the position of the vertex against the world, view, and projection matrices. output.position = mul(input.position, worldMatrix); output.position = mul(output.position, viewMatrix); output.position = mul(output.position, projectionMatrix); // Store the input color for the pixel shader to use. output.color = input.color; return output; }  
  • Popular Now