Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
45 user(s) are online (24 user(s) are browsing Forums)

Members: 1
Guests: 44

devils_advisor, more...
Support us!
Recent OS4 Files
OS4Depot.net



« 1 ... 6 7 8 (9) 10 11 12 »


Re: Shaderjoy 1.6
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@Petrol

Quote:

sometimes one click is sufiscient to switch fullscreen<>window mode.


I'm guessing that double click time of your Input prefs is long enough to register separate clicks as double clicks.

Quote:

If I switch off fps counter, render is smoother (like with 3Dcow program


Updating window title bar takes here ~900 microseconds when compositing effects are enabled, and ~300 microseconds without compositing.

   Report Go to top

Re: Shaderjoy 1.7
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
Version 1.7:

- Open all screens with SA_LikeWorkbench tag.
- Disable optimized bitmap allocation.
- Log OpenGL information during startup.
- Display version number on screen title bar.
- Fix an issue where FPS counter was not visible when started in fullscreen mode.

   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehill
1.7 fix issues with strange look of menu in fullscreen and my window->fullscreen->window bug switch.

Thumbsi !

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehill
Found some very small shader which produce just white screen: https://www.shadertoy.com/view/Wd2fDW

void mainImageout vec4 fragColorin vec2 fragCoord )
{
    
vec2 uv fragCoord/iResolution.xy;

    
uv *= 6.5;
    
    
float len;
    for(
int i 03i++) {
        
len length(uv);
        
uv.+=  sin(uv.iTime 0.3)*5.;
        
uv.+=  cos(uv.iTime 0.1 cos(len 2.0))*2.;
    }
    
    
vec3 col vec3(cos(len 0.3), cos(len 0.1), cos(len 0.1));
    
    
fragColor vec4(col,1.0);
}


Before sumbiting bug-report to nova, need to be sure what actuall issue is

I reduce shader much to simplify it, to just:

void mainImageout vec4 fragColorin vec2 fragCoord )
{
    
vec2 uv fragCoord/vec2(0.1,0.1);

    
uv *= 6.5;
    
    
float len;
    for(
int i 01i++) {
        
len length(uv);
        
uv.+=  1.0;
        
uv.+=  1.0;
    }
    
    
vec3 col vec3(cos(len 0.3), cos(len 0.1), cos(len 0.1));
    
    
fragColor vec4(col,1.0);
}



And this render static image on win32, while on os4 white screen.

Now, if we remove for(int i = 0; i < 1; i++) { , and shader start to looks like this:

void mainImageout vec4 fragColorin vec2 fragCoord )
{
    
vec2 uv fragCoord/vec2(0.1,0.1);

    
uv *= 6.5;
    
    
float len;

        
len length(uv);
        
uv.+=  1.0;
        
uv.+=  1.0;

    
vec3 col vec3(cos(len 0.3), cos(len 0.1), cos(len 0.1));
    
    
fragColor vec4(col,1.0);
}


Then image renders.

Like if "for" there, even with 1 pass (which mean like we do nothing) , then things go bad. Dunno currently what it mean. Mostly looks like "float len" being trashed somehow if it being in the "for" loop, and then later for cos() used bad values or so.

ps. Maybe we need to try that reduced version directly, without shaderjoy (what i mean is that to put everything inside of main() for tests, not inside of mainImage() which is called from main() , maybe it will be again something about wrong return values from other functions).


Edited by kas1e on 2020/5/22 8:58:42
Edited by kas1e on 2020/5/22 9:02:15
Edited by kas1e on 2020/5/22 9:04:10
Edited by kas1e on 2020/5/22 9:08:38
_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@kas1e

Quote:

Found some very small shader which produce just white screen: https://www.shadertoy.com/view/Wd2fDW


Yet another nice shader.

Found 2 workarounds:

1) move "float len;" outside the function, making it a global variable, or
2) initialize it, like "float len = 0.0;"

Maybe it's a somekind of an optimizer bug. For some reason compiler doesn't see that "len" is modified inside the loop?


   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehill
Thanks for more info! BZ created:
http://www.amiga.org/developer/bugreports/view.php?id=487

Do you think it worth to deral shaderjoy's topic with other buggy shaders not related to issues already reported, or there should be some new one like "bugs in NOVA's shader compiler?"

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@kas1e

Quote:

Do you think it worth to deral shaderjoy's topic with other buggy shaders not related to issues already reported, or there should be some new one like "bugs in NOVA's shader compiler?"


IIRC we don't have a generic Warp3D Nova topic, so in that sense another thread might be a good idea.




   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehill
Ok will do new one for next ones.

Btw, checking more sound shaders, found one failed because want iChannelTime. That one i assume exactly for sound and not for textures. Seems some timing can be get from sounds as well, so it not just some .raw format ?

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@kas1e

iChannelTime is documented to be channel playback time in seconds, so I wonder how it differs from iTime in practise. In any case it can be added if sound support happens.

   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehill
Have probabaly a good idea how integrate editor with less blood : add tooltype "editor=patch_to_editor_of_choice", and in the menu "main" add entry "Edit Shader". By default "editor" can be the one which ships with os4 by default like notepad, so tooltype will be editro=sys:utilities/notepad.

Once user load shader, then that entry highglitsh in the main menu (while no shader loaded,then it disabled). Then when shader loaded and this entry works, user press on it, and shader just opens in the editor of choice.

By this you have no needs to spend time on editor at all, and shader can be edited/tested/reloaded easy and pretty integrated. Only little moment there can be that you need to run editor in async mode so to not block work of main window where shader works.

Just as idea :) But users can use any editor they prefer: notepad, stormed, gvim, multiedit, codepad , even codebench and what else

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehill
Found issue which probabaly can be issue with iMouse implementation in shaderjoy. Use that test case as test:

void mainImageout vec4 fragColorin vec2 fragCoord )
{
    
// Normalized pixel coordinates (from 0 to 1)
    
vec2 uv fragCoord/iResolution.xy;
    
    
// Time varying pixel color
    
vec3 col 0.5 0.5*cos(iTime+uv.xyx+vec3(0,2,4));
    
    
float radius 0.5 iResolution.y//Size of circle

    
float c_d=length(iMouse.xy-fragCoord.xy)-radius;
    
vec4 myCircle=vec4(col,1.0-c_d*0.01);
    
    
// Background layer
    
vec4 background vec4(0.820.870.891.0); //Simple background

    // Output to screen
    
fragColor mix(backgroundmyCirclemyCircle.a);

}


Once you run it, resize a bit window (so to see better issue), then press the left mouse button (so "sun" will be grabbed by mouse), and move to the center. For now all ok. Then, try to move the "sun" by a mouse up and down: you can see it reverted. I.e. move down make it move up, and move up make it move down.


Another issue I found, is that resizing of the window quite often makes whole rendering overlap window borders. That reminds me issue i had before with some ogles2 ports, and if you use ogles2, then on context creation you better use "OGLES2_CCT_RESIZE_VIEWPORT, TRUE", so ogles2 will deal with for you.

Easy to reproduce it resize window back, from bigger to small one. See how it looks like then (press open in new tab for full size). See bottom and left borders after I resize a window from bigger to smaller one:

Resized Image

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@kas1e

iMouse.y will be fixed in 1.8.

For some reason I couldn't reproduce blitting issue by using the resize gadget but minimize gadget did it.

   Report Go to top

Re: Shaderjoy 1.7
Quite a regular
Joined:
2007/2/6 13:57
From Donostia (SPAIN)
Posts: 543
BTW I get an eeror with the last shader sample kas1e posted:
...
ERROR: 24:1: '' : unexpected token
ERROR: 40:0: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.


GL error 1281


Is this line:
vec3 col = 0.5 + 0.5 * cos( iTime + uv.xyx + vec3(0,2,4) );
If i change to a "simple":
vec3 col = vec3(0.5,0.5,0.5);

it works ok, shows "sun" and I can move it with mouse pointer.
As I don't know nothing about shader "code", maybe I have something wrong, but I just copy/marked and pasted example.


Full verbose output:

#version 310 es

precision highp float;


uniform vec4 iMouse;
uniform vec4 iDate;
uniform float iTime;
uniform float iFrame;

uniform vec3 iResolution;
uniform vec3 iChannelResolution[4];

uniform sampler2D iChannel0;
uniform sampler2D iChannel1;
uniform sampler2D iChannel2;
uniform sampler2D iChannel3;

out vec4 finalColor;

void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
vec2 uv = fragCoord / iResolution.xy;
// vec3 col = vec3(0.5,0.5,0.5);
vec3 col = 0.5 + 0.5 * cos( iTime + uv.xyx + vec3(0,2,4) );
float radius = 0.5 * iResolution.y;
float c_d = length(iMouse.xy-fragCoord.xy)-radius;
vec4 myCircle = vec4(col,1.0-c_d*0.01);
vec4 background = vec4(0.82, 0.87, 0.89, 1.0);
fragColor = mix(background, myCircle, myCircle.a);

}


void main(void)
{
vec4 color;
mainImage(color, gl_FragCoord.xy);
finalColor = color;
}
------>8--
ERROR: 24:1: '' : unexpected token
ERROR: 40:0: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.


GL error 1281

   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Javier
Don't worry, shader works, it can be just probabaly you had usual issues with copy+paste source code from browser to editors, and additional bad characters being added. Like some wrong-space between ) and ).

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@kas1e

Ok so if I enable "solid resize" (don't know the English name for it) in the GUI prefs then the blitting issue becomes visible easily. With old school resize I haven't seen it.

What kind of window resize settings you are using?

EDIT: issue should be fixed in 1.8. (Fractal Nova has the same bug.)


Edited by Capehill on 2020/5/27 17:04:02
   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehill
Is it possible to add for command line ability to give a name of shader to ? I.e. somehitng like "shaderjoy 1.frag" and it runs and 1.frag loaded and started ? Just can be tasty to made a filetype for, so dbl-click on .frag shaders in dopus/filer/wb/etc will result in opening it in shaderjoy.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@kas1e

It used to be possible before tooltypes support but then it was removed. Frag filetype sounds like a good idea, I will create a ticket for myself.

   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehill
Thanks ! :)

Another thing if you not die out of my requests : can you made be "async" when we load shader and/or ichannel(s) ? Currently when we do one of those actions, the shader execution halts. If i remember right it matter of adding a TRUE to some flag of asl_req ?

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: Shaderjoy 1.7
Just can't stay away
Joined:
2007/7/14 21:30
From Lothric
Posts: 1064
@kas1e

ASL requester is run inside event loop. To make it asynchronous, it would have to be multithreaded I guess. And then there would be some synchronization required between processes.

I need to think about it.

   Report Go to top

Re: Shaderjoy 1.7
Home away from home
Joined:
2007/9/11 12:31
From Russia
Posts: 6322
@Capehil
If it requere more than just 1 minute for such change, then its not big deal, skip it of course. It's not that important.

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top


« 1 ... 6 7 8 (9) 10 11 12 »



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project