Jump to content

  • Log In with Google      Sign In   
  • Create Account


JTippetts

Member Since 04 Jul 2003
Offline Last Active Yesterday, 08:13 PM

Topics I've Started

Introducing your new forum mod

24 March 2012 - 08:19 AM

Hey, folks. I've recently been made forum mod for Visual Arts. Seems dbaumgart is busy, busy these days. So there is a new sheriff around, and I'm looking to clean up this town. Going forward, I'd like to clean up a few of the stickies that are lurking around up there, maybe try to consolidate some of that into a single sticky or two, rather than the half-page that we currently have. So if any of you have any suggestions on what we want to keep, I'm all ears. There is some good stuff in there, but there are also a boatload of dead links. Thanks.

Josh

[web] Actionscript 3: Alpha blending using BitmapData.draw

22 June 2009 - 05:15 PM

Recently, I've taken to playing around with ActionScript 3 development using Flex, and I've run across something that puzzles me. Perhaps I'm missing something completely obvious, but... Is there a way to perform (SourceColor*SourceAlpha)+(DestColor*(1-SourceAlpha)) style blending using a BimapData.draw() call without using a Pixel Bender shader? I've perused the possible parameters for BlendMode but none of them seem to offer this sort of blending. I currently use a pixel shader to perform the operation, but I was wondering if there is a more obvious solution, particularly one that doesn't force the requirement of Flash Player 10 as shaders do (not that that is a bad thing, imo). [Edited by - JTippetts on June 22, 2009 11:36:45 PM]

Texture distortion on heightmapped terrain

14 October 2007 - 12:00 PM

When you texture a heightmapped terrain by tiling a texture across it, areas where there is a steep slope between adjacent heightmap samples tend to stretch the texture if the heightmap texture coordinates are evenly spaced. Until recently, I lived with it, but lately I've been wondering about ways to eliminate it. I attempted to re-calculate texture coordinates so that the actual length of the edge of a quad determines the spacing of texture coordinates along that edge, rather than the spacing of the samples in the x/z plane. So a quad with a steeper slope 'covers' more texture space than a quad with a shallower slope. On ridges and steep features parallel to the axes, this approach works well, as shown in these images. The first image is non-corrected terrain on a straight ridge, showing the stretching. The second image is corrected. Distorted Corrected However, doing it this way poses problems, since the 'correction' is actually just additional distortion which gets propagated across the remainder of the heightmap, so that on flat areas you can still see how the texture was stretched to accomodate the curve of the feature, as in the following images. The first image here is a mound, with un-corrected texturing, and the second is the same mound corrected. You can see in the second how the 'correction' continues across the map in a very ugly fashion. Distorted Corrected I've tried any number of means for calculating the correction, with no change in the result. Does anybody know of any other means for correcting the distortion that doesn't result in this ugliness, or is it just something you have to deal with with regularly spaced grids? Or am I doing something stupid? The terrain map function that actually calculates the texture coordinates after the grid mesh is constructed is:
void CTerrainMap::calcTextureCoords()
{
    float totals[m_meshmapwidth];
    unsigned int x,z;
    for(x=0; x<m_meshmapwidth; ++x) totals[x]=0.0f;

    for(z=0; z<m_meshmapwidth; ++z)
    {
        float s=0.0f;
        for(x=0; x<m_meshmapwidth; ++x)
        {
            CVec3f prev, cur, delta;
            // Do s
            if(x>0)
            {
                prev=m_vertex.get((int)(x-1), (int)z);
                cur=m_vertex.get((int)(x), (int)z);
                delta=cur-prev;
                float len=delta.length() / m_samplespacing;
                s+=len;
            }
            // Do t
            if(z>0)
            {
                prev=m_vertex.get((int)(x), (int)(z-1));
                cur=m_vertex.get((int)(x), (int)z);
                delta=cur-prev;
                float len=delta.length() / m_samplespacing;
                totals[x]+=len;
            }
            CVec2f tc;
            tc[0]=s*m_texturespacing;
            tc[1]=totals[x]*m_texturespacing;
            m_texcoord.set(x,z,tc);
        }
    }
}


Thanks.

Another random level tutorial: Turbulence

22 May 2005 - 03:20 PM

I've got a rough draft (funny how all these articles remain perpetually in a rough draft state, isn't it? [grin] ) of a new Accidental Engine tutorial up on the site. Some Uses of Noise and Turbulence deals with a method for using Perlin noise to noisify images, maps or functions , and is useful for reducing the occurrence of straight lines or smoothly predictable patterns. Take a look at it and let me know what you think.

New tutorial up: Randomly Generate Levels

31 October 2004 - 04:34 PM

Thought this might be an appropriate place to post about this. I've uploaded an early version of part 1 of my random level generation tutorials. I'm hoping to do a few of them, since I still have a lot more to say. This first part introduces the great and wondrous Tile Engine, which serves as a Lua-scripted test-bed for trying out different level generation techniques. It gives a quick run-down of the basic API the Tile Engine presents, and how to go about modifying and executing scripts. The Tile Engine is fairly simple, merely constructing the level according to the script then allowing the player to walk around using the NumPad. Pressing 'q' will exit, pressing 's' will take a screenshot, and pressing 'h' will re-display the help console. The application is still very, very rough so use it at your own risk. I have fixed a few bugs since first introducing it to some folks on #gamedev, but more still linger. More in-depth details for using the engine can be found in the tutorial itself. After introducing the Tile Engine, the tutorial then goes on to a general-case maze generation algorithm, and how it can be used as a basic building block for more complicated level construction. You can take a look at the tutorial here. For anyone who has been following the square vs. isometric tiles thread in this forum, the Tile Engine is the framework used to generate the posted screenshots. [grin] Take a look and let me know if you have any comments, criticisms or feedback of any sort.

PARTNERS