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

gigaworm

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

122 Neutral

About gigaworm

  • Rank
    Newbie
  1. Yeah the array is for the gradient but it only has 12 values in it, so if you tried passing 13 for example, it wouldn't work and I pass the values that are obtained through the texture lookup into it.    I've been messing about with it some more and I've used some if statements to try and debug it a little and find out what values are getting returned from the texture. A few things I've noticed are that if I make a texture of 10 width using:   float data[10] = {10,10,10,10,10,10,10,10,10,10};   and set it up the same way as I posted before with R32 Floats then some interesting things happen. If I sample to the first point in the texture using 0.1 as the co-ord and change the 10 to other numbers to see what value I'm getting then using 1 returns ~5.5 instead of 1 and using 4 returns exactly 7 instead of 4. Any idea why this is?
  2. Ah of course! its now changing the terrain which is good. I'm still trying to figure out what to pass in as co-ordinates though and for some reason when I use for example 0 which should point to 151, the array for the gradient doesn't get an out of bounds error which it should if the value is not between 0-11. I thought that maybe the value was just a fraction of that value or something so I tried adding 100 to gi0 after the look up so it would break out but it didnt, but it does if I set it to 100, whats going on?
  3. I tried that before but I get no output using it as a texture, and it doesnt change the terrain either :(
  4. Ok, heres my the code to set up the texture:   static int p[] = {151,160,137...131}; int index = 0; float data[512]; float data2[256]; for( int i = 0; i < 256; i++ ) {    data2[i] = ( p[index] ); index++; } for(int i=0;i<256;i++) { data[i] = data2[i]; } for(int i=0;i<256;i++) { data[i+256] = data2[i]; } ID3D11Texture1D* PermTexture = NULL; ID3D11ShaderResourceView* PermTextureSRV = NULL; D3D11_TEXTURE1D_DESC desc; desc.Width = 512; desc.MipLevels = 1; desc.ArraySize = 1; desc.Format =  DXGI_FORMAT_R16_FLOAT; desc.Usage = D3D11_USAGE_IMMUTABLE; desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; desc.CPUAccessFlags = 0; desc.MiscFlags = 0; D3D11_SUBRESOURCE_DATA dataDesc; dataDesc.pSysMem = data; dataDesc.SysMemPitch = 512; device->CreateTexture1D( &desc, &dataDesc, &PermTexture ); D3D11_SHADER_RESOURCE_VIEW_DESC descSRV; ZeroMemory( &descSRV, sizeof( descSRV ) ); descSRV.Format = DXGI_FORMAT_R16_FLOAT; descSRV.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE1D; descSRV.Texture1D.MipLevels = 1; descSRV.Texture1D.MostDetailedMip = 0; device->CreateShaderResourceView( PermTexture, &descSRV, &PermTextureSRV ); deviceContext->PSSetShaderResources(0, 1, &PermTextureSRV);  And then in the shader I have       Texture1D<float>   tex : register(t0);  SamplerState SampleType {     Filter = MIN_MAG_MIP_POINT;     AddressU = Wrap;     AddressV = Wrap; }; float test = tried lots of values here; float gi0 = tex.SampleLevel( SampleType, test, 0 ) ;      
  5. Hey, thanks for all your help, I'm still struggling to get this working. I'm now using DXGI_FORMAT_R16_FLOAT and that shows up when using it as a texture for the terrain so I know it has been created correctly, but when I try SampleLevel or Load, no matter what a pass in as co-ordinates it still outputs the terrain as if gi0,2 and 3 where equal to zero. I've made the texture 512 wide, and put divided ii by 256.0 and still nothing. I also tried converting the texture to a 1D texture instead and still nothing. Any ideas?
  6. So I need to wrap the texture when I create it to a 512 texture? Also, I used the texture I created as the texture for the terrain to make sure it was being passed in correctly and for some reason the only value that will output some form of texture is DXGI_FORMAT_R8_TYPELESS, otherwise I just get a black screen.    So for what to use as the texture parameter, something like this?       float ii = (i & 255)/256; float jj = (j & 255)/256; float gi0 = PermTex.SampleLevel( SampleType, ii+ (PermTex.SampleLevel( SampleType, jj, 0 )), 0 ) ;    
  7. Hi, I've been really struggling to find information on how to generate a terrain using noise on the HLSL. Currently I have a terrain generated on the gpu using a couple of octaves of simplex noise but it runs a little slow. To speed it up I am trying to use a texture for the permutation table, but I cant find much information on it. First of all, I'm not sure how to fill the texture with values from 0-255, so I'm currently doing this on the cpu side and passing it in as a shader resource:   int index = 0; int data[256]; for( int i = 0; i < 256; i++ ) {     data[i] = ( p[index] ); index++; }   Would this work the same way as an array filled from 0-255? Or am I doing it completely wrong?   Then in the simplex noise function in the effect file, I dont understand how to use it as the permutation table. Normally I just use: uint ii = i & 255; uint jj = j & 255; uint gi0 = perm[ii+perm[jj]] % 12; uint gi1 = perm[ii+i1+perm[jj+j1]] % 12; uint gi2 = perm[ii+1+perm[jj+1]] % 12;       Where perm was the array, to get the hashed gradients, but with the texture I nee to use:   PermTex.SampleLevel( SampleType, ??, 0 ) Any help would be amazing.