Beta release 4.0b

Information and change log about the latest ZGameEditor release.

Moderator: Moderators

User avatar
rrTea
Posts: 320
Joined: Sat Feb 15, 2014 9:54 am

Doesn't detect errors

Postby rrTea » Thu Apr 06, 2017 8:41 am

To me this looks like it shouldn't compile, but it does (note the last line):

int sum;
for(int i=0; i<10; i++)
{if(i>=5)continue;
sum+=i;
}}}}}}Lorem Ipsum

User avatar
VilleK
Site Admin
Posts: 1918
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Beta release 4.0b

Postby VilleK » Thu Apr 06, 2017 11:24 am

Indeed the compiler does not detect garbage if it comes last in the expression :). I should fix that.

User avatar
rrTea
Posts: 320
Joined: Sat Feb 15, 2014 9:54 am

Shouldn't compile?

Postby rrTea » Fri Jun 23, 2017 7:14 am

Maybe it doesn't matter if it's at the end, for example this also goes through (but nothing will be traced if you run it):

int inx,iny;
inx = 10;

} //mistake

inx += 2;
trace (intToStr(inx));

(I just found I posted something similar a long time ago:
viewtopic.php?p=8271#p8271)

User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Preview Window Malfunctioning

Postby 13r4nd0m » Mon Aug 07, 2017 11:50 pm

While working with shader components, I noticed the preview window showing weird stuff. The program ran correctly (with f9). After closing the project and restarting the computer, the preview window seemed to function correctly until I changed the fragmentshadersource code.

I then started a new project testing out some mesh stuff, the problem came back but this time on clicking the preview play button this error was thrown: #Access violation at address 006323A4 in module 'ZGameEditor.exe'. Read of address 00000018.
Attachments
meshProb.zgeproj
(924 Bytes) Downloaded 44 times
fragsourceProb.zgeproj
(2.45 KiB) Downloaded 28 times

User avatar
VilleK
Site Admin
Posts: 1918
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Beta release 4.0b

Postby VilleK » Tue Aug 08, 2017 7:37 am

Hi, the meshproblem error is because you need a "MaterialTexture" component to tie the Material and Bitmap together. I should add a test so it gives a better error message.

See modified project below.

The other project just shows a flashing image here. Not sure what the expected result is? Please compare with the sample zgeviz shader projects to get the basic view working.

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
  <OnLoaded>
    <SpawnModel Model="Model1" SpawnStyle="1"/>
  </OnLoaded>
  <Content>
    <Model Name="Model1">
      <OnRender>
        <UseMaterial Material="Material1"/>
        <RenderMesh Mesh="Mesh1"/>
      </OnRender>
    </Model>
    <Material Name="Material1">
      <Textures>
        <MaterialTexture Texture="Bitmap1"/>
      </Textures>
    </Material>
    <Mesh Name="Mesh1">
      <Producers>
        <MeshSphere RadialSamples="50"/>
        <MeshNoise Scale="0.3 1 1" NoiseSpeed="1 0 1" NoiseScale="1 1 1"/>
      </Producers>
    </Mesh>
    <Bitmap Name="Bitmap1">
      <Producers>
        <BitmapNoise Octaves="9" Persistence="0.77" ZHeight="42.08" Color="1"/>
        <BitmapPixels NOfPoints="43" Color="1"/>
      </Producers>
    </Bitmap>
  </Content>
</ZApplication>

User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Re: Beta release 4.0b

Postby 13r4nd0m » Thu Aug 10, 2017 6:02 am

Ok, that was my mistake on the meshproblem. Thanks for the clarification.

To replicate the shader preview bug in fragsourceprob:

Preview the project. Should be some random greyscale flashing with a black bar on the right.
Stop the preview.
Comment out lines 18 - 27 in Shader1 fragmentshadersource.
Uncomment line 16 in Shader1 fragmentshadersource.
Compile.
Preview the project. Preview window should show a gradient from white to black but instead shows black.
Run the project with f9 it displays correctly.

User avatar
VilleK
Site Admin
Posts: 1918
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Beta release 4.0b

Postby VilleK » Thu Aug 10, 2017 8:45 am

Ok, I could reproduce that. It seems the Shader component needs the "UpdateVarsOnEachUse" property set. Try that and it should work.

User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Re: Beta release 4.0b

Postby 13r4nd0m » Thu Aug 10, 2017 4:11 pm

Nice! Everything works as expected. Thanks for clearing that up, it helps a lot.


Return to “Releases”

Who is online

Users browsing this forum: No registered users and 2 guests