Volkovino

- Dec 20, 2022
- Joined Mar 21, 2021
- 1 best answer
- Edited
Below "uniform line" in shader gives "Expected datatype.-" error.
struct points{ vec2 p[8]; }; uniform points pointsArray;
Do I have syntax mistake?
- Edited
It is the 2nd step of previous question (https://godotforums.org/d/30871-method-to-convert-png-inclalpha-into-2-files-in-etc1-format-via-2-uniforms)
What I know regarding texture() and textureFecth() are detailed below.
texture() uses float within the UV coordinates and needs an info such as nearest or linear in openGL.
textureFecth() uses int within the texture/screen coordinates and needs an extra parameter "LOD"Previous reply (https://godotforums.org/d/22990-texelfetch-equivalent-in-gles2) is available for a similar help request .
SIsilicon28 The second function only applies a filter if you setup the sampled texture to do so. Most if not all Godot textures have a filter property. If you disable that along with mipmaps you are guaranteed to have no filters applied to the texture.
gba25 Thank you! It worked but texture still has very low accuracy. texelFetch was able to extract values from sampler2D with 32 bit float accuracySuccess seems partial.
I have converted a lot of Shadertoy codes from tectureFetch to texture together with int/float and UV/screen changes in Shadertoy and tranferring Godot. Almost % 50 of the code gives full success in 2 two mediums. others are not only have low accuracy problem and also full logic changes. And alot of missing.
I believe there is a way to implement the multiple texture() functions with a mipmap/LODs (and maybe offsets for linear/bilinear/trilinear) instead of a single texelFetch() command dor a full equivalency.
Maybe an array can work like in "vec4_type texture (sampler2DArray_type s, vec3 uv [, float bias])" with Mipmapped series.
Can you help me please?
- Edited
As understood, I am busy with GLES 2.0 and mostly oriented to 2D.
I am trying to setup a performant template to convert/split a png file into 2 ETC1 files one includes rgb, other includes alpha. MipMap included to call texture with offsets (because no preset in godot shaders regarding nearest/linear/bilinear/trilinear options. i do not know the performance effects with these calls) later.
Maybe mipmapped series can be added into ECT1 couples. So, maybe more than 2 Sampler2D required for one image.What i am looking for are listed below.
110 figure out ETC1 format properties
120 import ETC1 as mentioned above
120a in editor manually
120b on the fly with for multiple images
130 texture function implementation pretending texel fetch (a separate help request will be for this one)I have checked some documentation
1100
https://registry.khronos.org/DataFormat/specs/1.1/dataformat.1.1.html#ETC1
little bit confused. if you reply the other options it will be clearer.1200
https://docs.godotengine.org/en/stable/tutorials/rendering/gles2_gles3_differences.html#texture-compression
https://docs.godotengine.org/en/3.5/tutorials/assets_pipeline/importing_images.html#importing-textures
1200a - If you fill a sample for this one it will be perfect.
https://docs.godotengine.org/en/stable/classes/class_image.html
1200b - sample code will be perfectThanks in advance.
cybereality
I am still grateful to you. You opened up a blocked path to me.
So, and unfortunately for you, this means that a flood of questions (some maybe illiterated) will come soon.
Hope to get your precious help regularly.Many thanks as always ......
- Edited
any advice to direct me?
Super!!!!..... thx for the efforts......
- Edited
cybereality Hi,
Thanks for quick reply.
I know the base logic that gives the derivatives between the center pixel and each neighbour pixel on mentioned axis.
But little confusing about the function parameters (vec2 pos, vec4 frag, vec2 pixel). Original dFdx/dFdy takes only one parameter. Still I am hesitant which info in parameters should be included in the function.Any possibility to give a sample code snippet to call the function from fragment() with some quick comments?
e.g.:
vec2 pos = .... ..... ..... ..... // ........... ............. ...............
vec4 frag = .... .... ...... .... // ......... ............ ............. ...........
vec2 pixel = .... ...... .... ..... // ......... ........... ........... ..............Thx in advance...
I have found a sample project regarding Anti Aliasing by Viewport Post Processing via Derivatives (dFdx, dFdy and fwidth) in GLES 3.0.
Where can I get Anti Aliasing by Viewport Post Processing via another method in GLES 2.0?
Thx in advance.I have found proper tutorials regarding Fragment Shaders in the net such as Book Of Shaders, Shadertoy, Processing, etc. Even I have shared my own self teaching material by converting godot shader language (GLES 2.0) as a tutorial template. https://godotforums.org/d/30669-2d-fragment-shader-tutorial-series-beginner-to-advanced-gles-20
However I could not find any organised resource regarding vertex shaders in order to adapt into Godot Environment.
I also need built in godot vertex function and varying, which transfers the infom into fragment shader, samples [2D, GLES 2.0] .
Could you carry me away a starting point for those other than Official Godot Documents?Thx in advance
Hi Everyone,
I am a toddler as Godotista. When searching more optimised and performant results for a multi hundred nodes project, first tried GdQuest, then came across C++ native code support and shader infrastructure combined projects.
I believe Godot is a perfect and easy interface, prototyper along GdScript and starting environment but should be combined with those support eventually.
I have been concentrated to increase my C++ knowledge and to build shader infrastructure from scratch for 5 weeks.
During this period, first fruit , maybe it is simple, appeared as my self teaching tutorial. I have converted a shadertoy file into a Godot Project as shown below. Another one for Book of Shaders is in process.
Project Link: https://github.com/Volkovina/GLES-2.0-2D-Fragment-Shader-Tutorial-Series-in-Godot-Beginner-to-Advanced
All the details are in Readme file in the Link.
Godot Version: 3.4.4 Standard
Shader: GLES 2.0
Platform: Windows 10
Hope it will be beneficial for every one.
Note: Actually, recent month story started and goes on with the headlines below. still same.
- final target: multi hundred moving objects representing flowing water in 2D
- interim target: concave polygons
- interim target: alpha shapes
- interim target: post processing of the texture viewport which includes moving objects
- interim target: anti-aliasing in post processing shader
- interim target: vertex shader support to increase fragment shader performance
- interim target: search a full vertex shader tutorial in GLSL 2.0 and interaction examples between frag-vertex
- ...... goes on
All duly noted.
for the noob indies (like me) ,which suck and filter info slow, it was enlightening for the recent developments.
Now, I am aware about the possibilities and I can arrange the wide path to proceed regarding hardware, software, mobile market.Thank you for your intensive interest.
Thanks for all precious answers...
There is an impossible issue regarding Nvidia may support older cards with Vulkan driver on a close date.
There is a maybe about Godot 4.1 will support openGL in next stages.As far as I know from the info in the net,
most of the Android systems, on little older mobiles, have no support for Gles 3.0 (maybe Vulkan too)
For this reason, I use Gles 2.0 with Godot 3.x.I believe that brand new computer and brand new mobiles dependent development does not exactly fit with the Godot "free" philosophy, especially in these economical crisis days and specifically in third world countries.
At least, can anybody tell me whether the devs will continue to develop Godot 3.x for some additional years?
I have tried godot 4 - alpha 4 & alpha 9 releases (win64). However, i received same messages below respectively. Almost same except line of the code depends on assert.
My system is like that below.
Processor: Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz 2.60 GHz
Ram: 12 GB
OS: Windows10 - x64
Graphics Card: Embedded in Mainboard (driver details below)
Can I use Godot 4 any beta or stable release eventually with this configuration?
thanks for quick reply ....... i am on it...
There is data communication between GDScript and OS via HARD DISK.
for the clipboard "STRING" content, there is a way between them using OS.get/set_clipboard() methods via RAM.
However, for the clipboard "IMAGE/TEXTURE" content, i could not find a way to communicate via RAM.For instance, godot has such capability to get screenshot using "get_viewport().get_texture().get_data()". But it is only for GdScript internal use.
I believe Godot , which is flexible structure, must have this very basic method.
I am working on a narrow scope word processing software project which will include rich text editing, graph editing (graph nodes etc.) and image transfers from/to OS, I have checked Emilio's base studies concerning those subject
(
But I could not find any clue regarding my issue. If godot can not provide such a service. I need to change my path soon.Am I incompetent to find an available service or gdscript has not a method for such thing?
Thanks for any guiding in advance...
- In how to attach a gdscript code file (drawing_line.gd) to a node during runtime and to run the script
- Edited
I tried to attach a gdscript code to a child node during the runtime. But no effect of the script on run. Need help!!!
Thanks in advance.
Codes are below.
(attached script to the "parent" Node2D)
extends Node2D func _ready(): $Line2D.set_script(load("res://drawing_line.gd"))
(drawing_line.gd - gdscript which I tried to attach to the child node)
extends Line2D var line2D_coord_X1 = 697.1718063 var line2D_coord_Y1 = 157.0043504 var line2D_coord_X2 = 224.4594551 var line2D_coord_Y2 = -55.62737387 func _ready(): self.clear_points() self.add_point(Vector2(line2D_coord_X1, line2D_coord_Y1)) self.add_point(Vector2(line2D_coord_X2, line2D_coord_Y2))