Skip to content

Instantly share code, notes, and snippets.

View zacharycarter's full-sized avatar
👋

Tail Wag Games zacharycarter

👋
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.carterza"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="25" />
<application
android:allowBackup="true"
private static Texture generateNormalMapTexture(int width, int height, Pixmap pm) {
pixmap = new Pixmap(width, height, Pixmap.Format.RGBA8888);
texture = new Texture(width, height, Pixmap.Format.RGBA8888);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
Vector3 currentVertex = new Vector3(x, getPixelWrap(x, y, width, height, pm), y);
Vector3 pU = new Vector3(x + 1, getPixelWrap(x + 1, y, width, height, pm), y);
Vector3 pV = new Vector3(x, getPixelWrap(x, y + 1, width, height, pm), y + 1);
private static Texture generateNormalMapTexture(int width, int height, Pixmap pm) {
pixmap = new Pixmap(width, height, Pixmap.Format.RGBA8888);
texture = new Texture(width, height, Pixmap.Format.RGBA8888);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
Vector3 currentVertex = new Vector3(x, getPixelWrap(x, y, width, height, pm), y);
Vector3 pU = new Vector3(x + 1, getPixelWrap(x + 1, y, width, height, pm), y);
Vector3 pV = new Vector3(x, getPixelWrap(x, y + 1, width, height, pm), y + 1);
(1.0,1.0,1.0) (1.0,1.0,1.0) (1.0,1.0,1.0) (1.0,1.0,1.0) (1.0,1.0,1.0)
(1.0,1.0,1.0) (-0.109580524,-0.13520472,0.9847394) (0.2626328,0.18078528,0.9478083) (-0.16569309,0.150608,0.97460914) (1.0,1.0,1.0)
(1.0,1.0,1.0) (-0.05858313,0.26027337,0.9637561) (0.2237724,0.22589675,0.9481015) (0.45740846,-0.1558962,0.87548494) (1.0,1.0,1.0)
(1.0,1.0,1.0) (0.0718886,0.38858455,0.9186044) (-0.031058354,0.61177707,0.7904203) (-0.36537948,0.08543196,0.92693) (1.0,1.0,1.0)
(1.0,1.0,1.0)(1.0,1.0,1.0)(1.0,1.0,1.0)(1.0,1.0,1.0)(1.0,1.0,1.0)
private static Texture generateNormalMapTexture(int width, int height, Tile[][] tiles) {
pixmap = new Pixmap(width, height, Pixmap.Format.RGBA8888);
texture = new Texture(width, height, Pixmap.Format.RGBA8888);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
Vector3 normal;
// Ignore border pixels
if(
0.40029103
0.14666826
0.4971345
0.3946106
(0.3776829,0.5494452,0.98227966)
0.43119654
0.84139824
0.30933484
0.009570133
private static Texture generateNormalMapTexture(int width, int height, Tile[][] tiles) {
pixmap = new Pixmap(width, height, Pixmap.Format.RGBA8888);
texture = new Texture(width, height, Pixmap.Format.RGBA8888);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
Vector3 normal;
// Ignore border pixels
if(
//attributes from vertex shader
varying vec4 vColor;
varying vec2 vTexCoord;
//our texture samplers
uniform sampler2D u_texture; //diffuse map
uniform sampler2D u_normals; //normal map
//values used for shading algorithm...
uniform vec2 Resolution; //resolution of screen
precision mediump float;
//attributes from vertex shader
varying vec4 vColor;
varying vec2 vTexCoord;
//our texture samplers
uniform sampler2D u_texture; //diffuse map
uniform sampler2D u_normals; //normal map
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%LLL%LLLLLLLLLL%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%LLLLLLLLLLLL%L%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%LLLLLLLLLLLLLL%LL%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%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