• Content count

  • Joined

  • Last visited

  • Days Won


Pryme8 last won the day on November 1

Pryme8 had the most liked content!

1 Follower

About Pryme8

  • Rank
    Master Ninja
  • Birthday 04/29/1986

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Eureka, CA
  • Interests
    Crushing it

Recent Profile Visitors

3,043 profile views
  1. had to change: #ifdef LAYERS uniform highp sampler2DArray layers[LAYERS]; #endif to #ifdef LAYERS uniform sampler2D layers[LAYERS]; #endif >_<.... sometimes I feel dumb...
  2. Ok I can sample it just fine now, but it seems to drop an error reguardless: vec4 tile = texture(layers[0], texCoord); works, but drops the error: [15:11:42]: Error: ERROR: 0:37: 'texture' : no matching overloaded function found ERROR: 0:37: '=' : dimension mismatch ERROR: 0:37: '=' : cannot convert from 'const mediump float' to 'highp 4-component vector of float' Which is the same error as: Which was an example @Deltakosh put together to test texture arrays.
  3. So what is the correct syntax to sample from a texture array? The equivalent to: vec4 tile = texture2D(sampler, texCoord); but for an Array not a single sampler2d. I have tried : vec4 tile = texture3D(sampler, vec3(texCoord.xy, 0); and the webGL 2.0 version... vec4 tile = texture(sampler, vec3(texCoord.xy, 0); But I keep dropping: 'texture' : no matching overloaded function found ERROR: 0:37: '=' : dimension mismatch ERROR: 0:37: '=' : cannot convert from 'const mediump float' to 'highp 4-component vector of float'
  4. Texture Scale

    You just need to construct your own cube then and have the uv’s aligned in the manor that will work for you.
  5. Texture Scale Your camera is just aligned wrong.
  6. Texture not Binding to Shader?

    I am having trouble assigning a texture array: I have tried: uniform sampler2DArray sprites; and uniform sampler2DArray sprites[4]; But I keep getting: 1 #version 300 es 2 #define LAYERS 0 3 #define NUM_BONE_INFLUENCERS 0 4 precision highp float; 5 #define pU 0.00392156862 6 7 uniform float time; 8 uniform float fps; 9 uniform vec2 viewOffset; 10 uniform vec2 viewportSize; 11 uniform float spriteSize; 12 13 uniform sampler2DArray sprites; 14 uniform sampler2DArray layers; 15 16 in vec3 vPosition; 17 in vec2 vUV; 18 in vec2 pixelCoord; 19 in vec2 texCoord; 20 21 22 out vec4 glFragColor; 23 void main(){ 24 vec2 spriteCoord = mod(pixelCoord, spriteSize); 25 vec3 color = vec3(spriteCoord.x,1.0,spriteCoord.y); 26 if((texCoord.x > 1.0 || texCoord.x < 0.0 || texCoord.y > 1.0 || texCoord.y < 0.0)){color = vec3(0.0); } 27 float alpha = 1.0; 28 29 glFragColor = vec4(color, alpha); 30 } 31 'sampler2DArray' : No precision specified ERROR: 0:14: 'sampler2DArray' : No precision specified No clue what I am doing wrong... Is it because "precision highp float;" is not the first line? **EDIT* uniform highp sampler2DArray sprites[4]; ^^ got it
  7. Shader Texture Atlas Support

    With a solid color like that you would never need mips, effectively you could get away with a 4px by 4px image to do what your demonstrating above. I would recommend just turning off mips for now and continuing development with the NEAREST and no mips method. The whole point of the mip maps is for getting rid of texture artifacts and sharpness at a distance (and to save memory) but if you use like a fog pass or some secondary pass you can clean up the "choas" on the texture at a distance. Just move on and worry about it more once your really finishing stuff up.
  8. Shader Texture Atlas Support

    It will generate as many steps as it’s needed to reduce the image to a 1x1
  9. Shader Texture Atlas Support see how it uses a "buffer" of data around the actual texture, its kinda a oddball thing to wrap your head around but this explains it decently. and here is some discussion on to mip or not to mip
  10. that was a rhetorical question.
  11. Shader Texture Atlas Support

    lame, yeah you would need to do a buffer around them. Its a little more complicated but doable. I would recommend reading up on stuff like this:
  12. Shader Texture Atlas Support

    No it was the sampling mode was just creating artifacts, try some of the other ones that include MIP in its sampling mode, and see what happens. These are just quick fixes the real fix is a good amount of glsl scripting, but for the most part if you get the sample mode correct most of your problems should be fixed.
  13. Shader Texture Atlas Support

    Its automatically handled in the gl pipeline when you bind a texture. Just bind the texture and set the noMipmaps to false (or its default) and the GPU creates the mipmaps and stores them in the memory. If you have the flag set to true it does not generate them, and thats when you will have to use NEAREST_SAMPLING for it to work, it will only be if you need the texture to soften up some that you will want to generate the mips and then mess with the sampling mode until you find one that gets rid of the artifacts.
  14. Shader Texture Atlas Support ok what mipMaps are is basically an octree representation of the texture embeded into to memory. so it turns the texture into something like this: This is for performance/bottle necking there is no reason to display or calculate the full texture if its way far away basically. The system handles this on its own, and is a part of just the gl pipeline. When you do not generate mips it keeps the texture as is no matter what the LOD step is. Which can create artifacts and is not the most efficient, but is the simplest to wrap your head around. Now the sampling modes will need to change only if you generate mips this is because when it samples if it does nearest it will mess things up as the LOD level changes because you will want to sample from the same mip region as the the texture LOD.