Logo by Trifox - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. January 20, 2019, 07:17:17 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: I broke 3DKn-1.0.x  (Read 461 times)
Description: Sorry!
0 Members and 1 Guest are viewing this topic.
AtomicNixon
Forums Newbie
*
Posts: 7


« on: August 27, 2017, 09:48:42 PM »

So I was digging around in the DE tracers today to familiarize myself with what's under the hood, but also with the goal of putting in a quick fix-it for stereo renders.  What I came up with was simple, did work, should have worked, but crashes Frag the moment you do something real with it.  Here's what I added in...

uniform bool RightEye; checkbox[false]
uniform bool LeftEye; checkbox[false]

void main(void) {
   gl_Position =  gl_Vertex;
   coord = (gl_ProjectionMatrix*gl_Vertex).xy;
   coord.x*= pixelSize.y/pixelSize.x;
   viewCoord = gl_Vertex.xy;
   viewCoord2= (gl_ProjectionMatrix*gl_Vertex).xy;
   from = Eye;
   Dir = normalize(Target-Eye);
   UpOrtho = normalize( Up-dot(Dir,Up)*Dir );
   Right = normalize( cross(Dir,UpOrtho));
       if (RightEye) {from-=Right*0.1;}    //simple shift left and right, made simply simpler to root out error.
        if (LeftEye) {from+=Right*0.1;}
   coord*=FOV;
   init();
}

Too simple.  Never had a problem mixing variable types like that and is definitely not verboten, as if any such thing would be under C++  smiley  It works fine of course, shift right and left relative to viewer, with the top side up, but the second I do something, anything really, crashola.  I'm thinking that change might screw something up further down the line maybe?  Are there some variables I've got to shift along with "from" to avoid some math error?  Oh, I've tried it with ver 1.0.0, 1.0.1, and 1.0.5, called by DE-RaytracerKn-1.0.0 and DE-Kn10.

Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #1 on: August 27, 2017, 10:22:17 PM »

Hi, I just tried the code you posted. It seems to work fine with Buffershader 1.0.1 (in 3D shader) although the multiplier Right*0.1 should perhaps be smaller, I think, more like Right*0.01 but that might just be as a result of object proximity to the viewer in the scene I was testing. No crash with FragM v2.0.b

You can use script control to render alternating frames or 2 sequences, "L" and "R", for post processing into a video.

What version of FragM are you using?
What gfxcard do you have?
What is your OS?
Do you get any error messages?

Looking at your code, it doesn't seem to do anything that would cause a problem undecided

edit: you seem to be missing a couple of lines... lines 4&5 in the main() function but my test was without them and it didn't crash smiley.
Code:
  // we will only use gl_ProjectionMatrix to scale and translate, so the following should be OK.
   PixelScale =vec2(pixelSize.x*gl_ProjectionMatrix[0][0], pixelSize.y*gl_ProjectionMatrix[1][1]);
« Last Edit: August 27, 2017, 10:45:10 PM by 3dickulus, Reason: missing lines » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
AtomicNixon
Forums Newbie
*
Posts: 7


« Reply #2 on: August 28, 2017, 05:41:26 AM »

Hi, I just tried the code you posted. It seems to work fine with Buffershader 1.0.1 (in 3D shader) although the multiplier Right*0.1 should perhaps be smaller, I think, more like Right*0.01 but that might just be as a result of object proximity to the viewer in the scene I was testing. No crash with FragM v2.0.b

You can use script control to render alternating frames or 2 sequences, "L" and "R", for post processing into a video.

What version of FragM are you using?
What gfxcard do you have?
What is your OS?
Do you get any error messages?

Looking at your code, it doesn't seem to do anything that would cause a problem :-

edit: you seem to be missing a couple of lines... lines 4&5 in the main() function but my test was without them and it didn't crash smiley.
Code:
  // we will only use gl_ProjectionMatrix to scale and translate, so the following should be OK.
   PixelScale =vec2(pixelSize.x*gl_ProjectionMatrix[0][0], pixelSize.y*gl_ProjectionMatrix[1][1]);

The 0.1... when nothing makes sense, simplify simplify and something about spherical chickens in a vacuum.  Well, solved.  I've been using Scorpion's build and switching to your new build (thank you very much!) took care of all gremlins.  I knew it had to be something like a compiler issue, because that's definitely too simple to fail code.  (can you call adding a single variable to one line, "code"? smiley )  Thanks once again for the platform and the code examples.  I've been meaning to get to GPU programming for ages and it's an absolute blast doing it on a platform like this, and with subject material like this.  I've been showing people Hal's work on Guardians II, and I'll stand by my assessment that we ain't seen nothing yet, that procedural graphics is going to be as transformative as the introduction of 3D itself.  

Well, back at it.  Current problem, getting polyfold married to KaliBoxMod and have it come out like this.  Almost a meta-problem, mystery... why is it that the code, so simple, lines up so well, and you still don't get what you're expecting.  I'm guessing a pile more of this "lurning" stuff is the trick.
 
Edit: Almost forgot.  Couldn't find anything specifying right/left rendering in the list of script commands, is there a complete list kicking about?


* pollyMain3a009392.jpg (114.79 KB, 640x480 - viewed 128 times.)
« Last Edit: August 28, 2017, 05:58:23 AM by AtomicNixon » Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #3 on: August 29, 2017, 02:59:48 AM »

The right left switching would be controlled via fqs Fragmentarium Qt Script , it's java-ish, you can find examples in the fqScript folder and some documentation here  https://en.wikibooks.org/wiki/Fractals/fragmentarium
I just started wiki-ing some docs for this proggy, still needs a bit of polishing up, initially I am only documenting what's in the prog and not how to use it, that will come later once all of the commands, menus, dialogs etc. are in the wiki wink

under the Render menu you will see Edit Cmd Script this will open a very crude editor and allow you to Save Execute Stop Close

if you know java then this stuff will be easy but I'll give a quick tut...

setup your scene and then in the script main loop...
Code:
for (i = 0; i <= maxFrames; i+=1) {...
you can
 
Code:
app.setParameter("RightEye", true);
 app.setParameter("LeftEye", false);
 app.setOutputBaseFileName("./anim/right/test." + pad(i) + ".png");
 app.setParameter("RightEye", false);
 app.setParameter("LeftEye", true);
 app.setOutputBaseFileName("./anim/left/test." + pad(i) + ".png");

this will place images in the left and right folders and name them test.nnnnn.png

but of course you have complete control via fqs and if you pay attention to the examples you'll be crunching animations in no time... well render time at least wink


* fqScript-editor.png (29.84 KB, 626x468 - viewed 122 times.)
« Last Edit: August 29, 2017, 03:06:42 AM by 3dickulus » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
AtomicNixon
Forums Newbie
*
Posts: 7


« Reply #4 on: September 07, 2017, 06:13:10 AM »

Quote
If you know java then this stuff will be easy but I'll give a quick tut...

but of course you have complete control via fqs and if you pay attention to the examples you'll be crunching animations in no time... well render time at least wink

I think I'll pass on adding yet another layer since it's so trivial to pop an offset in, now that I know how and where to put it.  Frag reminds me of that first raytracer, DKB-Raytrace (POV-Ray!!), nothing but code!  But.... ever find yourself wishing you could forget a few things?  I really don't think I'll need Pascal, Fortran or 6502 machine anymore.  At least Acad-Lisp trickled out of my ears a long time ago, hoorah!!  cheesy  As for crunching videos, shit, that's what's kept me from actually learning GLSL for oh, a year!!  The 3D and 360 stuff was just check-marks really.  If someone asks me can you do X or Y I never want the answer to be "Haven't a clue!", it should always be "No prob.  What and by when?"

<a href="https://www.youtube.com/v/gTAmft32O4c&rel=1&fs=1&hd=1" target="_blank">https://www.youtube.com/v/gTAmft32O4c&rel=1&fs=1&hd=1</a>
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Dammit...I Broke It! Mandelbulb3D Gallery lenord 0 254 Last post October 02, 2010, 12:22:08 AM
by lenord
SunSky with 3DKn-1.0.1.frag for advanced DoF Fragmentarium Crist-JRoger 5 637 Last post September 19, 2017, 07:46:51 PM
by Tim Emit

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.118 seconds with 28 queries. (Pretty URLs adds 0.005s, 2q)