• 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.

whisp

Members
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

102 Neutral

About whisp

  • Rank
    Newbie
  1. I figured out a possible solution for the problem. The data passed from a vertex program to a fragment program always gets interpolated. It's not possible to pass custom values that don't get interpolated, thus the interpolation needs to be removed in the fragment shader. In this case i need the non-interpolated model-space-coordinates of the vertices in order to look up the tile-map texture. In the vertex shader i calculated the texture coordinates: // Texture Coordinates, 1/8 of the tileset OUT.texCoord = OUT.pageVertXZ.xy * 0.125; With this coordinates the vertex position can be calculated in the fragment shader: // set texCoord relative to 0,0 float2 pageVertXZ = floor(indata.texCoord * 8); The interpolation-value just gets cropped, what's left is the vertex coordinate in model space.
  2. Hi! I'm desperately trying to get a simple shader running. What i want is to texture a terrain page of 65 * 65 vertices with tiles from a textur atlas, using a second texture, the tile-map, to lookup the respective tile-type to use. Shaders are new to me, so it's likely that i didn't understand some of the logic i'm using. Instead of the tiles looked up in the tile-map it just repeats the whole tile-atlas a few times over the terrain page. In the following my shader code commented with what i think the respective lines should do. It should output the top left tile from the texture atlas, but instead it outputs, as mentioned earlier, the whole tile-atlas a few times over the page: [source lang="cpp"]// Output structure struct VP_Output { float4 wvpos : POSITION; float2 texCoord : TEXCOORD0; float4 pageVertXZ : COLOR; }; // Vertex program VP_Output TerrainVP( float4 position : POSITION, uniform float4x4 worldViewProj) { VP_Output OUT; // World position OUT.wvpos = mul(worldViewProj, position); // Position relative to model (top left vertex xz in page is 0, 0) OUT.pageVertXZ.xy = position.xz; // Texture Coordinates, 1/8 of the tileset (tile set contains 8 * 8 tiles, 256 * 256 pixels) // In the fragment shader the texture coordinates will be set to 0,0 + the automatic interpolation OUT.texCoord = OUT.pageVertXZ.xy * 0.125; return OUT; } // Output structure struct FP_Output { float4 color : COLOR; }; FP_Output TerrainFP(float2 texCoord : TEXCOORD0, float4 pageVertXZ : COLOR, uniform sampler2D lookupTex : TEXUNIT1, uniform sampler2D decal : TEXUNIT0) { FP_Output OUT; // set texCoord relative to 0,0 float2 tc2; tc2.xy = texCoord - pageVertXZ.xy * 0.125; // This should output the respective pixel color of the first tile (top left) from the atlas OUT.color = tex2D(decal, tc2); return OUT; }[/source] Any help is appreciated. Thanks whisp