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 - MichaelJPCT

Pages: 1 ... 5 6 [7] 8 9 10
91
Support / multiple coordinates for texture stages?
« on: August 12, 2016, 10:32:27 am »
i created a heightmap terrain using Object3D(pos,normal,uv,index,textureID) method.
if i want the the terrain to have at least 2 layers of texture tile - one large tile(repeat 4x4) & one smaller tile of noise(repeat 128x128). in what way should i set it up?
should i use shader?

92
Support / less verbose console info?
« on: August 09, 2016, 08:21:16 am »
i encounter a problem, the console information is too much (such as compiling object3d to VBO), sometimes the latter information fills the console buffer so i can't read the former ones. can i define what information should be printed in the console? (in MS Windows)

93
Support / Re: questions about render-to-texture
« on: July 11, 2016, 01:47:55 pm »
i may create a software FB of small size when i need those effects.

94
Support / Re: questions about render-to-texture
« on: July 11, 2016, 10:14:06 am »
for question 1 and 2 , i guess if i obtain all pixel data from the RTT texture and put into another texture , then the other texture would be the same as ordinary textures , right?

edit: i read the doc again and seems like there is no api that obtains pixel data from a RTT texture.

95
Support / questions about render-to-texture
« on: July 10, 2016, 04:43:22 pm »
i am new to RTT, and i am now using FrameBuffer.setRenderTarget() to render into textures. (the FrameBuffer is the same one as the main window)

1) i blit white text into a texture after clearing FB with black color. when the texture is applied to a transparent Object3D, the black part is visible. but i have another texture loaded from a grayscale PNG file, where the black part is invisible. why isn't the RTT texture tranparent?
2) the doc says RTT must not use mipmaping. but if a texture will never be rendered into again after the first time, can it have mipmaping afterwards?
3) if a texture has size of 32x32 while the FB is 1280x800, when rendering into the texture, is the renderer doing work on 32x32 pixels or 1280x800 pixels? i mean the workload, is it small or large.

96
Support / Re: full screen mask with continuous changing alpha?
« on: July 08, 2016, 08:27:44 am »
now it works perfectly. thanks.

97
Support / full screen mask with continuous changing alpha?
« on: July 07, 2016, 07:30:09 am »
i am trying to use Overlay to make a full screen mask. the mask must be able to change alpha from zero to full opacity, continuously.
i applied a black texture with alpha to the Overlay.
i tried different combination of alpha value(Texture) and transparency(Overlay), i just couldn't have it changing continuously.

1) Texture.setAlpha() has no effect on the Overlay, maybe an texture upload per frame is required.
2) i tried Texture.overrideTexelData(), it seemed to work. but it requires texture uploading, it clearly slows down the program.
3) the argument to Overlay.setTransparency() isn't the same thing as alpha, when i tried, 0 resulted in full transparency, 4 resulted in full opacity. and it's in integer, not float.

what else can i try?

98
Support / suggestion on API, setTranslation, setMatrix, setOrigin
« on: July 06, 2016, 09:23:12 am »
when i want to position an Object3D, if the object has children, i can't use setOrigin(), i must set the translation.
but there is no setTranslation(), there is translate() which requires relative position.
but most of the time i don't directly know how much should i move the object, instead i know the current position of the object. so i call clearTranslation() then translate(), or set the Matrix of the object. in case i just need to position an object at a certain position, i don't need a Matrix, isn't setTranslation() a better method?
and if Object3D has a setMatrix method like this, setMatrix(float[] matrixFloatArray), that can be convenient too.

and some APIs require a SimpleVector as argument, such as setOrigin(SimpleVector vec), why not a method like setOrigin(float x,float y,float z) ?

99
Support / Re: trying to make an LOD system
« on: July 02, 2016, 12:43:37 pm »
i will cancel the LOD system for now, to make the program simpler.

but i have another question:
if an Object3D is invisible (setVisibility or removed from world), but it has children and parent. would JPCT engine do translation to every object in the tree, in these 2 cases?
case 1: all objects in the tree are invisible
case 2: only one object in the tree is visible
because i don't like to waste CPU time doing translations on invisible objects, if the object quantity is large, doing translation would cost much CPU time.

100
Support / Re: Diffuse coloring
« on: July 01, 2016, 06:49:24 pm »
it works. thanks.
and the Texture constructor is so convenient that i can easily create a collection of colors.

101
Support / Re: Diffuse coloring
« on: July 01, 2016, 12:25:03 pm »
i went into the same issue. i tried setAdditionalColor, but it can not simulate a material with diffuse lighting.
for example, i have an object without texture, if object.setAdditionalColor(0,0,0) and sun color is (255,255,255), when a polygon faces the sun directly, the polygon is pure white. it almost looks like specular, but it shouldn't be.
i want a black polygon to look gray when it faces the white sun. what can i do? must i use shader?
PS: the sun is a Light which is placed far away, and never fades.

102
Support / Re: trying to make an LOD system
« on: July 01, 2016, 12:11:49 pm »
in my previous thought, when an instance of myObject (with an array of Object3D) is considered a parent, then each Object3D in the array is a parent of the child of this instance of myObject, so an Object3D in the child instance of myObject has an array of Object3D as parents.
or you were suggesting separate object trees for each LOD level? this should be a much simpler way, but then every part in the tree must have the same LOD level.
i think this is good enough in some cases.

103
Support / Re: trying to make an LOD system
« on: July 01, 2016, 10:32:33 am »
your suggested way looks more simple on the app side.
but in JPCT engine, if an Object3D(a child) has multiple parents(which are also children of other Object3D's), would it do transformation only based on the visible parent(current LOD)?
and does JPCT do transformation to the invisible Object3D's ?

104
Support / trying to make an LOD system
« on: July 01, 2016, 10:14:25 am »
i plan to have an LOD system in my graphics module. basically in a class of mine there is an array of Object3D or Mesh, and i can choose which LOD should show up. the problem is , should i use an array of Object3D or Mesh?
i originally planned to use Mesh, and use setMesh() to switch Mesh when i need another LOD. but later i read the forum and saw that UV data were stored in Object3D, not Mesh.

on the other hand, the downside of using array of Object3D, is that:
i have an object tree, each object can have multiple children that inherit its transformation. when i switch LOD, i have to call Object3D.removeParent, Object3D.addParent, world.removeObject, world.addObject... on multiple Object3D's.
Java performance is quite good, and these calls should not cost much, but it just looks like some trouble.
i can also do it without the parent system from JPCT, meaning that i do all transformation in my code, and use setOrigin, setOrientation, setTranslationMatrix etc to position the Object3D's. then i don't need to call removeParent,addParent, but my code for transformation would grow large, that's some trouble too.

is there a simpler way to make an LOD system?

105
great! i will try these.

Pages: 1 ... 5 6 [7] 8 9 10