Questions from new user

All topics about ZGameEditor goes here.

Moderator: Moderators

User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi fracteed,
fracteed wrote:What is the advantage of meshes under model definitions? I noticed some of the sample projects did that.
Every clone / instance of a model has their own copy of all components that are placed in the Definitions node. So in case you want all clones to use the exact same Mesh, don't put the Mesh in the Definitions node. But if you want each clone to have their own copy of the Mesh ( in order to procedurally generate / modify the mesh for each individual clone ), put it inside Definitions.
fracteed wrote:The console displays the total number of models when a project is run, but is there any way of seeing the total number of triangles? Would be very useful for optimizing.
I'm afraid not ( at the moment ) .. you can only see the triangle count for individual Meshes. Thing is, triangle count isn't as big of a factor when it comes to performance these days though. But you can always use gDebugger to find out what the GPU bottlenecks of your project are.
fracteed wrote:Is there any way of saving out components/hierarchies for use in another project...for instance reusing a sound or mesh component that I have created?
Certainly :) Simply select the component(s) you want to copy and use good ol' copy-paste. Since ZGE uses the XML format for its project files, you can even paste your component onto the forum. Like this ..

Code: Select all

ZZDC<?xml version="1.0" encoding="iso-8859-1" ?>
<Mesh Name="MyMesh">
  <Producers>
    <MeshBox XCount="15" YCount="15" Grid2DOnly="255"/>
    <MeshExpression>
      <Expression>
<![CDATA[float y = noise2(this.v.x,this.v.y);
this.v.z = 0-this.v.y;
this.v.y = y;]]>
      </Expression>
    </MeshExpression>
  </Producers>
</Mesh>
To copy this "snippet" back into a project, simply select the entire quote and use Ctrl+C ( or right-click > Copy ), and then in ZGE select for instance App:Content and use Ctrl+V ( or right-click > Paste Component ).

K
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Hi Kjell.....cool , I am digging the copy/paste capability. This will be very handy for building a reusable library of assets. Though it would be nice to have a save/load xml on that right click menu 8)

I am finding the fact that the console still works while I am running on my Android tablet very handy indeed. One thing I can't work out is how to use the trace function to display a float?

If I use intToString it truncates it....any workaround?

cheers...
User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi fracteed,
fracteed wrote:I am digging the copy/paste capability. This will be very handy for building a reusable library of assets.
You can change the Library.xml file that comes with ZGameEditor if you want ( accessible through the "Add from library" option ).

Image

And since Library.xml is basically a .zgeproj with only components in App:Content, it's pretty straight-forward to maintain.
fracteed wrote:One thing I can't work out is how to use the trace function to display a float?
There's no build-in function for that ( unfortunately ). So instead, add a ZLibrary component to App:OnLoaded with the functions posted in this thread.

K
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Thanks Kjell, that is a great tip about the library being a zproj file!

I have done a forum search but not really come up with any leads on creating a fullscreen glow/bloom effect. Are there any existing posts or projects on how to create such an effect. Keeping in mind that I know next to nothing about open gl shader code :oops:

Can I just copy/paste some existing code from another engine...not sure how engine specific it would need to be?

cheers....
User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi fracteed,
fracteed wrote:I have done a forum search but not really come up with any leads on creating a fullscreen glow/bloom effect.
I'd recommend rendering your game to a texture ( using the RenderTarget components ), then render that texture with a horizontal blur applied to another texture, and finally render that texture with a vertical blur applied & mixed with the original texture to the screen.
fracteed wrote:Can I just copy/paste some existing code from another engine...not sure how engine specific it would need to be?
Mostly yes. Any engine that uses regular GLSL ( just like ZGameEditor ) is a good candidate to "borrow" shaders from.

Just keep in mind that when you want to use shaders on Android, you have to use the programmable / modern pipeline ( App:GLBase = ES2 ), which means that anything you render requires a shader.

K
Post Reply