• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Interface & Usage v
« Previous 1 … 3 4 5 6 7 … 32 Next »
AutoUV shaders [updated: 05/13/2020]

 
  • 1 Vote(s) - 5 Average
AutoUV shaders [updated: 05/13/2020]

Kagehi
Offline

Junior Member

Posts: 31
Threads: 5
Joined: Nov 2012
#22
12-04-2015, 04:21 AM
Yeah. Tried a different and much more interesting one.

http://glslsandbox.com/e#29078.0

Rechecked the ones you used and replaced the resolution bit with the auv one that you used, set up the time as a slider (though I have no clue whether time runs from 0.0 to 1.0, or if its like seconds passed, but I tried just replacing it with 0.1 at one point...

Yeah.. Have no clue what I am screwing up... Will post the modded code here, maybe you can figure out what is bugged, and we can both learn something. lol

Code:
uniform float time; %% Tried just setting this to 0.1, but current version uses a slider.
uniform vec2 auv_texsz; %%Replaced here so it uses the Wings native resolution thing?

vec3 roty(vec3 p,float a){return p*mat3(cos(a),0,-sin(a),0,1,0,sin(a),0,cos(a));}

float map(in vec3 p) {
    float res=0.;vec3 c = p;
    for (int i = 0; i < 10; i++) {
        p =0.9*abs(p)/dot(p,p) -.7;
        p.yz= vec2(p.y*p.y-p.z*p.z,2.*p.y*p.z);
        res += exp(-20. * abs(dot(p,c)));}
    return res/2.0;}

vec3 raymarch(vec3 ro, vec3 rd){
    float t = 4.0;
    vec3 col=vec3(0.);float c=0.;
    for( int i=0; i<64; i++ ){
        t+=0.02*exp(-2.0*c);
        c = map(ro+t*rd);              
        col += vec3(c/2.0,c*c*c,c)/10.0;}    
    return col;}

void main(){
    vec2 p = (gl_FragCoord.xy-auv_texsz.xy/2.0)/(auv_texsz.y);
    vec3 ro = roty(vec3(3.),time*0.3);
    vec3 uu = normalize( cross(ro,vec3(0.0,1.0,0.0) ) );
    vec3 vv = normalize( cross(uu,ro));
    vec3 rd = normalize( p.x*uu + p.y*vv -ro*0.3 );
    gl_FragColor.rgb = 0.5*log(1.0+raymarch(ro,rd));}

Code:
{name, "Test"}.                  % The name in the shader selector
{vertex_shader, "standard.vs"}.     % Vertex shader used
{fragment_shader, "test_shader.fs"}.    % Fragment shader used
{auv, auv_texsz}.                   % vec2 width and height
{uniform, {slider,0.0,4.0}, "time", 0.1, "Time"}.

Obviously, the two things missing here that you normally have with code is a) error checking, and b) reports on crashes/what is actually happening. :p This is like.. throwing things at a black box and wondering, "WTF?" lol

In any case, both my attempts to do this resulted in -- totally blank textures, as in no image and 100% transparent. Just weird...
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
AutoUV shaders [updated: 05/13/2020] - by micheus - 10-22-2015, 08:55 PM
RE: AutoUV shaders - by tkbd - 10-25-2015, 02:18 AM
RE: AutoUV shaders - by micheus - 10-25-2015, 01:14 PM
RE: AutoUV shaders - by dgud - 10-26-2015, 10:43 AM
RE: AutoUV shaders - by micheus - 10-26-2015, 03:47 PM
RE: AutoUV shaders - by dgud - 10-26-2015, 06:59 PM
RE: AutoUV shaders - by tkbd - 10-27-2015, 12:59 PM
RE: AutoUV shaders - by Nova - 10-27-2015, 09:21 PM
RE: AutoUV shaders - by micheus - 10-28-2015, 12:46 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 10-29-2015, 07:09 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 11-06-2015, 12:55 AM
RE: AutoUV shaders [updated: 10/29/2015] - by Nova - 11-07-2015, 08:24 AM
RE: AutoUV shaders [updated: 10/29/2015] - by Nova - 11-07-2015, 09:15 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 11-08-2015, 02:05 AM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 11-10-2015, 09:56 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 11-19-2015, 03:19 AM
RE: AutoUV shaders [updated: 10/29/2015] - by tkbd - 11-19-2015, 11:21 AM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 11-21-2015, 01:33 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 11-21-2015, 03:18 PM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 11-21-2015, 08:47 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 11-23-2015, 03:54 PM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 12-04-2015, 04:21 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 12-04-2015, 12:50 PM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 12-04-2015, 01:40 PM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 12-05-2015, 03:35 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 12-05-2015, 09:14 AM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 12-05-2015, 01:55 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 12-05-2015, 03:58 PM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 12-06-2015, 12:47 AM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 12-08-2015, 05:04 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 12-08-2015, 06:49 PM
RE: AutoUV shaders [updated: 10/29/2015] - by Kagehi - 12-09-2015, 12:02 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 12-23-2015, 10:28 AM
RE: AutoUV shaders [updated: 10/29/2015] - by ggaliens - 12-23-2015, 02:53 PM
RE: AutoUV shaders [updated: 10/29/2015] - by oort - 10-20-2016, 08:43 PM
RE: AutoUV shaders [updated: 10/29/2015] - by dgud - 10-20-2016, 08:58 PM
RE: AutoUV shaders [updated: 10/29/2015] - by oort - 10-20-2016, 09:02 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 10-21-2016, 03:55 PM
RE: AutoUV shaders [updated: 10/29/2015] - by oort - 10-21-2016, 08:56 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 10-21-2016, 09:00 PM
RE: AutoUV shaders [updated: 10/29/2015] - by oort - 10-21-2016, 09:04 PM
RE: AutoUV shaders [updated: 10/29/2015] - by linkoboy - 10-23-2016, 11:23 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 10-23-2016, 01:46 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 10-24-2016, 05:49 AM
RE: AutoUV shaders [updated: 10/29/2015] - by oort - 10-25-2016, 01:26 PM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 10-25-2016, 07:55 PM
RE: AutoUV shaders [updated: 10/29/2015] - by oort - 10-26-2016, 03:00 AM
RE: AutoUV shaders [updated: 10/29/2015] - by dgud - 10-26-2016, 09:57 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 10-26-2016, 03:50 PM
RE: AutoUV shaders [updated: 10/29/2015] - by dgud - 10-26-2016, 09:13 PM
RE: AutoUV shaders [updated: 10/29/2015] - by oort - 10-27-2016, 12:21 AM
RE: AutoUV shaders [updated: 10/29/2015] - by rwoods - 06-22-2019, 02:43 AM
RE: AutoUV shaders [updated: 10/29/2015] - by micheus - 06-22-2019, 03:50 PM
RE: AutoUV shaders [updated: 10/29/2015] - by rwoods - 06-22-2019, 10:08 PM
New texture shader: Image Mixer - by micheus - 05-13-2020, 10:31 PM
RE: AutoUV shaders [updated: 05/13/2020] - by tkbd - 05-21-2020, 11:43 AM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode