shadertest | A Python library for unit testing GLSL functions | Unit Testing library
kandi X-RAY | shadertest Summary
kandi X-RAY | shadertest Summary
A Python library for unit testing GLSL functions.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Return the contents of the README . md file .
shadertest Key Features
shadertest Examples and Code Snippets
Community Discussions
Trending Discussions on shadertest
QUESTION
I have a total of two textures, the first is used as a framebuffer to work with inside a computeshader, which is later blitted using BlitFramebuffer(...)
. The second is supposed to be an OpenGL array texture, which is used to look up textures and copy them onto the framebuffer. It's created in the following way:
ANSWER
Answered 2020-Dec-21 at 22:41vec4 c = texture(texAtlas, vec3(iCoords.x%16, iCoords.y%16, 7))
QUESTION
I am following the following shader to create a blur.
OpenGL es 2.0 Gaussian blur on triangle
First i generate framebuffers.
...ANSWER
Answered 2020-Sep-13 at 06:27In the implementation of the shader, the value for sigma has to be in range [0.0, 1.0]. A radius of 30 seems to be to large. Start with u_sigma = 0.5
and u_radius = 10
.
The the shader effect still looks wrong, because the computation of the alpha channel is wrong.
You have copied the shader form a WebGL. WebGL by default uses premultiplied alpha, but your desktop application does not. See Straight versus premultiplied.
Skip the division of the weighted sum of the color channels by the weighted sum of the alpha channel:
gaussCol.rgb = clamp( gaussCol.rgb / gaussCol.w, 0.0, 1.0 );
QUESTION
I'm trying to make a shader-backed parallax effect using shader code listed here. But what I get is only a white screen.
Also the forum post here says that "code doesn't use a SpriteBatch, it renders the Mesh directly with the texture parameters set up in the shader".
I've never seen ShaderProgram to be used without setting it to a batch before, so might be I'm missing something very fundamental here.
...ANSWER
Answered 2018-Apr-17 at 17:40That FullscreenQuad class uses a_texCoord0
for the UVs name, but the shader from the tutorial uses a_texCoords
. These names need to match.
To avoid difficult-to-debug problems like this, I would recommend not turning off ShaderProgram.pedantic
while doing development builds. But do use it for releases to avoid hard crashes.
Unrelated to your issue: The tutorial's last three lines in the fragment shader put a lot of hope in non-guaranteed compile-time optimizations. GLSL already has an optimized linear interpolation function. It might also be faster to only calculate RGB, since alpha will be unused in the end. The last lines should be changed to something like this.
QUESTION
One gets strange results when modifying values of float variables inside a conditional statement when a uniform or texture coordinates are used in the condition. This happens inside a fragment shader on numerous mobile devices like iPhone 4S, iPhone 5, iPhone 5S, iPhone 6 (Safari, Chrome and Firefox), Samsung J3 (Android browser, Chrome) and quite possibly others. It seems the value can be compared to another float, but when is divided one gets zero if the divisor is more than half bigger than the value. Here is a simple test case. All values of R, G and B colors are expected to be the same 128 and the output should be thus grey, however on these mobile devices one gets R equal to zero and so the output is of sea color. The jsfiddle is here
The html is:
...ANSWER
Answered 2017-Jun-06 at 05:55I don't know how to work around low percision issues except to change your math not to run into the but you can conditionally ask for high percision
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install shadertest
You can use shadertest like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page