Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - lawless_c

Pages: 1 ... 3 4 [5] 6 7
Support / Re: Which comes first: setvertexcontroller or build?
« on: November 10, 2014, 03:02:28 pm »
vertices are the lines not the faces
Neither...they are the end points of the lines.

oh right, sorry.

Support / Re: Which comes first: setvertexcontroller or build?
« on: November 10, 2014, 11:55:13 am »

Support / Re: How to perform attachments effect by jpct-ae?
« on: November 07, 2014, 06:40:18 pm »
The sphere could a shader done around a spherical object

edit: i dont think it would need to be as complex as the one in the link though as you aren't trying to simulate light scattering.
if you can use the shaders you may be able to set it so fragments at right angles to the camera are less transparent than those facing it.

Support / signed distance field fonts
« on: October 09, 2014, 01:38:25 am »
Thought this might be of interest to you guys , ive been working on a simple package for doing signed distance field fonts on Android.

It's shader based on what Paul Houx did here with Lib Cinder to implement valves paper.

And i have also written it so it uses SDFFonts in the his generator outputs them.

It's incomplete at the moment but i hope to add more to it as i go along, and if other people want to make additions to it or fork it into something better thats even better. I think it may be useful for display some small amounts of text on screen(ideally without distortion at many resolutions) , at the moment the text can look a bit rough.

Support / Shaders, possible optimization?
« on: September 08, 2014, 03:28:42 pm »
This is just thought i haven't had a chance to try yet.

But i have multiple floats being sent to a shader, at the moment i do them one at a time.
Would it make more sense to simply add all these floats to an array and send them in one setUniform command?

So instead of using

setUniform(String name, float val) ;
setUniform(String name, float val) ;
setUniform(String name, float val) ;
setUniform(String name, float val) ;

I would use setUniform(String name, float[] val) ;

Support / Re: Shifting an objects position in shaders
« on: August 28, 2014, 10:56:23 am »
 :) Thanks, i'll try casting them when i get the chance.

I wanted to because i figured if i get this right  it will give me much more control. I would only have to use one texture containing the characters, I would be able to use this at various sizes.and things like borders and glow effect on text could be done in the shaders too.

I've already created a factory too that parses the data and creates the strings, my intention was to make it as it's own package and leave on it github for people here to use, improve , fork etc.

Support / Re: Shifting an objects position in shaders
« on: August 28, 2014, 02:39:14 am »
I'm taking in the offsets and advance floats that are usually numbers like 48.0 , 52.1 etc
I think i may need to modify to work with "clip space" which seems to be -1.0 to 1.0 (not sure how though)

If you're wondering what it's for im attempting to implement signed distance field fonts. I actually managed to get it working with multiple overlays, one per each character but im trying to do it with a single one now. The repeat rendering sort of works in that it will draw each character in a string, however they all end up in single spot.

The uniforms bottomleftx and bottomlefty are finding where in the texture a character is before it's rendered(this works) though some characters end up being skewed
as the overlay dimensions don't match the character.

Code: [Select]
   public boolean repeatRendering() {
      if(renderingIndex < charactersList.length && renderingIndex > 0)
      advances = advances + charactersList[renderingIndex].advanceX;
      Overlayshader_.setUniform("a_colour",new SimpleVector(1,(renderingIndex*0.1f),0));
      Overlayshader_.setUniform("bottomLefty", charactersList[renderingIndex].bottomLefty);   
      return true;
      return false;

This is an example show three different strings i've added, the bottom one demonstrates a single character string a skewed zero.

And my vertex shader code

Code: [Select]

precision highp float;

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;

uniform float bottomLeftx;
uniform float bottomLefty;

uniform float width;
uniform float height;
uniform vec3 a_colour;

uniform float offsetx;
uniform float offsety;

attribute vec2 texture0;
attribute vec4 position;

varying vec4 v_color;
varying vec2 v_texCoord;

void main()
v_color = vec4(a_colour.x,a_colour.y,a_colour.z,1.0);

v_texCoord.x = bottomLeftx + (texture0.x/width);
v_texCoord.y = bottomLefty + (texture0.y/height);

vec4 newpos = vec4(offsetx,offsety,0,0);

gl_Position = projectionMatrix*((modelViewMatrix  * position) +newpos);


Support / Re: Shifting an objects position in shaders
« on: August 27, 2014, 01:55:42 am »
Actually is it possible to update gl_position in repeatRendering()for a renderhook?? or even an Overlays coordinates? I cant seem to change these past when they are first set.

Support / Re: Shifting an objects position in shaders
« on: August 22, 2014, 02:32:23 pm »
I'll give that a shot, would gl_FragCoord work too? maybe if i altered that instead of naively thinking i could alter gl_position.

Support / Shifting an objects position in shaders
« on: August 22, 2014, 01:08:14 pm »
Is it possible to shift the position of pixels being drawn in JPCT? im trying to render something and im using IRenderHooks repeatRendering method with an overlay and i want to shift it to the right on each rendering.

I've tried changing the overlay position itself in the repeatRendering method , that doesn't work however because of the way rendering all those objects remain in the same place.

The only way i can think is perhaps with pixel shaders, which i dont believe JPCT supports.

edit:  I may be misunderstanding how the shaders work but so far attempts to sue gl_position to shift the position of where i want a pixel to appear have failed.

What is it doing?

Support / Re: Can shaders be applied to textures?
« on: June 19, 2014, 02:30:58 am »
I'll give that shot , if I find something that works I'll report back what I got working here.

Support / Can shaders be applied to textures?
« on: June 16, 2014, 11:24:28 pm »
I wanted to know this as id like to know if i't possible to apply shaders to textures such as for a UI, or something that will get placed on the framebuffer. The only way i can currently think of doing this might be to apply it to a flat mesh and have against the camera.

Support / Re: Multiple shared shaders
« on: June 03, 2014, 01:06:46 am »
oh yes  ;D ;D ;D ;D

For some silly reason i thought IrenderHook could only be implemented with via a shader object.

It works perfectly now with the IrenderHook implemented by entities themselves. (hopefully this wont bite in the ass later but it seems to work  ;D)

Pages: 1 ... 3 4 [5] 6 7