Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
glsl-georender-style-texture
Advanced tools
Readme
glslify module to read from a georender style texture
var glsl = require('glslify')
var regl = require('regl')()
var draw = regl({
frag: glsl`
precision highp float;
varying vec4 v_color;
void main() {
gl_FragColor = vec4(v_color);
}
`,
vert: glsl`
precision highp float;
#pragma glslify: Area = require('glsl-georender-style-texture/area.h');
#pragma glslify: readArea = require('glsl-georender-style-texture/area.glsl');
uniform sampler2D texture;
attribute vec2 position;
varying vec4 v_color;
void main() {
float zoom = 10.0;
float featureCount = 50.0;
float featureType = 6.0;
Area area = readArea(texture, featureType, zoom, featureCount);
v_color = area.color;
gl_Position = vec4(position,0,1);
}
`,
uniforms: {
texture: regl.prop('texture')
},
attributes: {
position: [-0.8,-0.8,+0.0,+0.8,+0.8,-0.8]
},
elements: [0,1,2]
})
require('resl')({
manifest: {
texture: {
type: 'image',
src: './example/texture.png',
parser: function (data) { return regl.texture({ data }) }
}
},
onDone: function ({texture}) {
regl.frame(function () {
regl.poll()
regl.clear({ color: [0,0,0,1], depth: true })
draw({texture})
})
}
})
to run example:
https://github.com/peermaps/glsl-georender-style-texture
npm install
.npm run example
. you should see output like Server running at http://192.168.129.29:9966/
.(the directions above assume that you have node.js and npm installed. instructions are for usage on the command line.)
in the example code, if you change the featureType
value, the color of the triangle should change. try values like 1.0, 18.0, 40.0.
if you'd like to generate your own texture.png
, you can use
georender-style2png.
#pragma glslify: Point = require('glsl-georender-style-texture/point.h');
#pragma glslify: readPoint = require('glsl-georender-style-texture/point.glsl');
#pragma glslify: Line = require('glsl-georender-style-texture/line.h');
#pragma glslify: readLine = require('glsl-georender-style-texture/line.glsl');
#pragma glslify: Area = require('glsl-georender-style-texture/area.h');
#pragma glslify: readArea = require('glsl-georender-style-texture/area.glsl');
return a Point from a style texture, for a given feature type, zoom, and total number of features (featureCount).
return a Line from a style texture, for a given feature type, zoom, and total number of features (featureCount).
solid
, 10.dot
, 6.dash
, default is 10.line-fill-dash-length
is short
, 10.line-fill-dash-length
is medium
, 15.line-fill-dash-length
is long
, 20.solid
, 10.dot
, 6.dash
, default is 10.line-stroke-dash-length
is short
, 10.line-stroke-dash-length
is medium
, 15.line-stroke-dash-length
is long
, 20.line-fill-style
is dash
. values from 0-100. default is 50 (dash and dash gap are equal length).line-stroke-style
is dash
. values from 0-100. default is 50 (dash and dash gap are equal length).return an Area from a style texture, for a given feature type, zoom, and total number of features (featureCount).
npm install glsl-georender-style-texture
MIT
FAQs
glslify module to read a georender style texture
The npm package glsl-georender-style-texture receives a total of 3 weekly downloads. As such, glsl-georender-style-texture popularity was classified as not popular.
We found that glsl-georender-style-texture demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.