Jump to content

Madjack

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by Madjack

  1. MG Thanks for that - I've followed the steps listed and framework appears to be up and running. Next step, get my background/distant terrain rendering up and running again.
  2. So I've finally gotten my ex-Xors + BMX codebase to compile under Leadwerks. From what I can tell, the way to go is to use Framework in order to have easy access to LE's various special fx. Is that correct? Any issues I should be aware of with Frameworks + BMX? I've grabbed the copy from the SDK install and incorporated it into my code. An initial problem is that some commands mentioned in the docs + wiki don't seem to be included in the BlitzMax version. Namely: GetFrameworkLayer GetFrameworkListener GetLayerCamera GetLayerWorld What am I missing? <edit> or could I write my own functions for the above? Something like; Local LAYER_DEFAULT:TLayer = GetFrameworkLayer(1) Local CAMERA:TCamera = GetFrameworkCamera(LAYER_DEFAULT) Function GetFrameworkLayer:TLayer(LAYER_index:int) select LAYER_index case -1; Return fw.background case 0; Return fw.Main case 1; Return fw.transparency end select End Function Function GetFrameworkCamera:TCamera(LAYER_check:TLayer) Return LAYER_check.CAMERA End Function
  3. One thing about going from Xors to LE - LE's much more strict (see what I did there) about declaring variables where as Xors allows any old integer as a surface/mesh/pivot pointer. So it's painful to convert from a large codebase from Xors to LE (as I'm doing now), but the extra structure is going to pay off with better code.
  4. mb Duh! Looks like I could just use LoadPixmap / ReadPixel to get the colour values - doesn't need to be a texture. Would using a pixmap likely cause any issues with LE do you think?
  5. mb Thanks for the info - sorry, I was a little impatient. Currently converting my large Xors codebase to LE and I'm finding the process quite distressing But I'll get on top of it!
  6. Hi all Any further info anyone can provide regards the above? Usually when people stop responding it's because of a fundamental misunderstanding on the part of the OP. Is that the case here? Am I out of line?
  7. LE doesn't allow native access to pixel data? Seriously? <EDIT> This makes no sense to me. So I can create a buffer for a texture and store texture channel data in that buffer but there's no easy way to read a colour at a given x/y? For example ; Local TEX_TEMP:TTexture = LoadTexture("abstract::CHECKERBOARD.JPG") Local T_BUFFER:TBuffer = CreateBuffer(256, 256) SetBuffer(T_BUFFER) SetColorBuffer(T_BUFFER, TEX_TEMP) GetColorBufferXY(T_BUFFER) ' Something like this does not exist in LE??
  8. NA Err - how do I read a pixel color from a texture? I can't see a corresponding readpixel or getcolor command.
  9. Ok - time for another dumb newbie question. I'm looking to load an image and read pixel colours (with which to ultimately deform a mesh) I would have thought loadimage would be the one, but I'm finding defining a TImage is giving a 'Identifier TImage not found' error when used with the framework. Strict Framework leadwerks.engine Local j_image:TImage I'm using BMax v1.45, LE is up to date. Remove the framework ref and the code compiles ok. Is anyone else experiencing this? What am I missing?
  10. Nakof As an ex-Xors user, keep an eye on the number of surfaces in your scene. Xors doesn't seem to do much internal batching of surfaces and so framerates can quickly drop. If you can make objects single surface, all the better.
  11. After chatting with MB above, looks like it'll be something to be handled via shader. Will need to investigate...
  12. Hi all I simply want to scroll a texture on a mesh. In Blitz3d or Xors I would get the surface brush, brush texture and set the texture's UV in-code via PositionTexture(texture, u,v). I see I can get a material's texture via GetMaterialTexture but there doesn't appear to be commands to adjust UV? Is this something that it has to be handled within the material's associated shader?
  13. NA Basically this - where an additive texture blends with the base diffuse texture in order to give the glowing edge Tron style. Turns out it was because my buffer creation didn't include BUFFER_COLOR3 in the declaration
  14. Really need some help regards this issue (thanks NA for your valiant attempt) To reiterate, simply want a diffuse texture on level 0 and an additive texture on level 1. What am I missing??? I can set up a material that uses mesh_diffuse_glow.frag for the pixel shader and I have a diffuse texture on texture 0, and my additive texture on texture 1. The material editor then correctly shows the additive texture blending with the texture layer. Additionally, if I load the mesh into an editor scene, it appears correctly in the scene with the additive texture blended with the diffuse texture. However if I load the mesh into model viewer, it only shows the diffuse texture. Also, if I load the mesh into my BMax prog, it only shows the diffuse texture. Why? Why is there a difference between what I see in the editor and the model viewer??? What's going on??? <edit> Macklebee has just kindly helped me out on this issue. Simple matter of making sure buffer creation included BUFFER_COLOR3, as that is the buffer the glow shader outputs to. Got to say, as a newbie, this was not at all clear to me. gbuffer = CreateBuffer(GraphicsWidth(), GraphicsHeight(), BUFFER_DEPTH | BUFFER_COLOR0 | BUFFER_COLOR1 | BUFFER_COLOR2 | BUFFER_COLOR3) It seems my error was using code from the wiki which apparently is well out of date in that I copied code from the wiki BMX PDF examples. Had no idea that I was missing a buffer call. Bumpmapping/specular seemed to work as expected.
  15. Does Leadwerks have GetMeshwidth/depth/height commands? Can't seem to find the equivalent...
  16. Ok - looks like I can assemble models in Lightwave 11's layout, export to FBX and use the fbx2gmf convertor. Mesh hierarchy and relative centres appear to be retained. Not quite there yet but looks promising. <edit> scale needs to be set to 0.01 when exporting for 1:1 fbx mesh size. Mesh layer names are retained in final GMF file, top level object is a model class. Pivots are not exported. Guess I can get around that - perhaps single vertex meshes or if that may cause problems, find and replace in code. Loading an LW scene file into UU3d and export to FBX results in mesh hierachy being retained but relative mesh centres are reset to 0,0. Looks like UU3d is not quite as good a conversion tool as I thought it was. Looks like I can use Lightwave 11 to set up objects and scenes and export through the fbx plugin. Need to do more testing to see if LW's surface system has any follow through with the plugin. Probably too much to ask.
  17. Oh for a single app that understands and converts; Multiple UV maps Multiple texture layers Smoothing groups Parent/child relationships Mesh names Off centre mesh positioning Looks like another evening of testing coming up.
  18. Damn. Was really hoping to have a simple, clear artpath with LW -> UU3d -> GMF. It's frustrating that UU3d does pick up child names but then loses that info when exporting to GMF. UU3d does pick up other info correctly (UV maps, smoothing groups) and will convert my png files to DDS + mat files. Using the provided LE convertors with FBX/DAE exported from LW also seems to lose child names. LE crashes when trying to load DAE exported directly from LW 11. My previous workflow (using Xors), was to model in LW, export using Terrabit's LW convertor, import into Giles, add child pivots etc, tweak texture layers as needed, name children, export to B3d, use loadanimmesh to retain child structure. This was about as long an art pipeline as I'd want to get to. Anyone know who's responsible for the GMF plugin?
  19. I'm using Lightwave as my modelling app. Unwrap3d can import LW files and sucessfully export to GMF along with material files and DDS textures. In LW modeller I can name mesh layers and UU3D picks up these names as group names. Problem is the export to GMF seems to replace that info with something much less useful GetEntityKey(entity, "name") returns U3D_STATIC_MESH for all children What am I missing here?
  20. NA Thanks for the hints. I'm not sure that what you've suggested is exactly what I'm after though. My terminology probably isn't clear. I essentially want to recreate the effect of having an additive texture on the second or third texture layer. I would have thought that setting texture01 to the additive texture and then using mesh_diffuse_glow.frag would do the trick. When I do this, the material preview seems correct and the editor shows the additive texture coming through the diffuse texture just fine. However I'm only seeing the diffuse texture in the model viewer and my BMax code also shows a cube with just the diffuse texture. I don't understand why I'm seeing different results between the material editor + editor vs model viewer + code. I've probably missed something I guess. I'm using the following to view the cube. Framework leadwerks.ENGINE RegisterAbstractPath("C:/Leadwerks Engine SDK") GCSetMode(2) Graphics 800, 600 WORLD = CreateWorld() ;If Not WORLD RuntimeError "Failed to create world." gbuffer = CreateBuffer(GraphicsWidth(), GraphicsHeight(), BUFFER_DEPTH | BUFFER_COLOR0 | BUFFER_COLOR1 | BUFFER_COLOR2) light = CreateDirectionalLight() RotateEntity light,[45.0,45.0,45.0] cam = CreateCamera() MoveEntity cam, Vec3(0, 0, -31) 'Create a visual mesh OB = LoadMesh("abstract::box_1.gmf") While Not KeyHit(KEY_ESCAPE) UpdateAppTime() TurnEntity OB, Vec3(.1, .1, .1) SetBuffer(gbuffer) RenderWorld() SetBuffer(BackBuffer()) RenderLights(gbuffer) Flip(1) Wend
  21. Downloaded the evaluation kit last night and am spending the day checking it out. Have a question however. I'm interested in being able to set glowmaps in order to achieve a 'Tron' like appearance on my models. (In Blitz I could achieve this by adding a second additive texture layer to a surface.) I understand LE uses a somewhat different system with materials/shaders. To test this, I've set up a simple cube with a single material that has a diffuse map in texture0 and a glowmap at texture1. The shaders used are: Shader: Vertex:mesh_diffuse_vert Pixel:mesh_diffuse_glow.frag Shadow Shader vertex:mesh_shadow.vert Pixel:none This appears to give me the effect I want going by the preview showing in the materials editor. The model also displays the additive glowmap texture correctly when added to a scene in the editor. However the model viewer doesn't show the glowmap layer. Additionally, my BMax code (adapted from the code generated by the projectbuilder.exe), doesn't show the glowmap on the cube either.. I note the oildrum model does appear ok with specular/bumpmapping. I've ensured there is only one gmf file and one set of dds textures that the abstract path can find. The debuglog indicates LE is finding the relevant textures/material file. Any ideas? Nvidia GTX560, Win7 - latest Nvidia drivers. BlitzMax
×
×
  • Create New...