Jump to content

Search the Community

Showing results for tags 'procedrual normals'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. So I am generating a Terrain Heightmap with a rtt. The idea is besides the zones texture size of 1024x1024, I am trying to have it generate a gutter around the applicable area so when I go to calculate normals I can sample a point that is off the zone. Now I am kinda lost on where to go from here, When sampling the texture I am doing it be detail units so pseudo code: var overflowUnit = textureSize/meshSubDivs; textureSize.xy += overflowUnit*2; then when I iterate over it: var pID=0; for(var y=1; y<detail.y+2; y++){ for(var x=1; x<detail.x+2; x++, pID+=3){ xUV = x/(detail.x+2); yUV = y/(detail.y+2); xp = (Math.floor(size.x*xUV)-this.args.overflow.x)+1; yp = (Math.floor(size.y*yUV)-this.args.overflow.y)+1; id = (xp*4)+(yp*size.x*4); var v = (this.getMapDataAtID(map, id)).r; v = this.transposeRange(v/255, this.args.heights.x, this.args.heights.y); vDat.positions[pID+1] = v; } } Now, how would I use this loop to manually define the normals? Pretty sure all the data is there. http://www.babylonjs-playground.com/#N123V9#23 *edit* http://www.babylonjs-playground.com/#N123V9#25 seems my numbers are off by a bit.
×
×
  • Create New...