Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / model texture flickers

Author
Message
jmsdev
16
Years of Service
User Offline
Joined: 6th Jul 2010
Location:
Posted: 6th Jul 2010 20:50
i am having problems getting a direct x to display with the texture in place when i have a white textured floor the direct x model stands on. If i change the floor texture to a dark color or don't display one the model texture comes out right. I think it has something to do with the lighting but nothing i try works

any ideas?
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 6th Jul 2010 23:27
You could always try updating your graphics drivers.

jmsdev
16
Years of Service
User Offline
Joined: 6th Jul 2010
Location:
Posted: 6th Jul 2010 23:44
not sure updating the graphics driver will help, happens on 2 different machines. different video cards. I will try it anyway to see what happens

thanks
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 7th Jul 2010 00:25
I think we need to hear/see a little more information before we can really diagnose the issue.

A screenshot of good and bad result might help.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Jul 2010 14:14
The only situation I've come across where a texture would appear to flicker is when you have z-fighting - two or more polys that are close enough together that the graphics drivers cannot correctly determine which is nearer.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 7th Jul 2010 15:24 Edited at: 7th Jul 2010 15:25
Hmmm, you are using a plain aren't you?

Just to add what Ian has already said - that might be an issue depending on how the floor is made - I mean, if the level model has a floor itself, but I'm wondering if this could be caused by using a cube instead of a plain. If you take a cube and squish it, you get an easy floor, but squish it too much and it might have these issues, where the bottom of the cube is too close, or even in the same place as the top of the cube. Add onto that, if you are lightmapping the level, then perhaps it hates your floor model, maybe it gets really confused when mixing a code-made floor with a repeated texture with a .X model.

Post some details about how you are creating the floor, and adding the level model. If you can supply the media, then you are far more likely to get a solution.


Health, Ammo, and bacon and eggs!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Jul 2010 16:43
Could it be a sync issue? I've noticed things tend to flicker unless I use manual syncing with sync on/sync, etc. But, other than that, I favour IanM's z-fighting suggestion.

A simple example project with code and media would be helpful.
jmsdev
16
Years of Service
User Offline
Joined: 6th Jul 2010
Location:
Posted: 7th Jul 2010 20:18
i will post the code tonight, sorry for the delay
jmsdev
16
Years of Service
User Offline
Joined: 6th Jul 2010
Location:
Posted: 7th Jul 2010 20:23
example code using direct x file, seems to happen on different x files
rem ***********************************************
REM - Setup up the video display
CLS
SET DISPLAY MODE 1024,768,32

REM - Setup up the font
SET TEXT FONT "verdana"
SET TEXT SIZE 14
REM - Setup lighting
SET AMBIENT LIGHT 60
COLOR AMBIENT LIGHT RGB(255,255,255)
HIDE LIGHT 0
MAKE LIGHT 1
COLOR LIGHT 1, 1024, 100, 100
COLOR LIGHT 1, 255, 255, 255
set point light 1,0,0,500
POSITION LIGHT 1, 0, 50, 400
SET LIGHT RANGE 1,1024
SHOW LIGHT 1
REM - Setup camera
sync on:sync rate 60
set camera range 0,10000
autocam off
SET NORMALIZATION ON



REM - Load images
load image "floor.bmp",1
`load image "wall.bmp",2
load image "wall.bmp", 2
load image "sky.bmp",3
load image "grass.bmp",4
load image "wall_with_door.bmp", 5
load image "wall_with_2_door.bmp", 6


REM DISPLAY
remstart
print "the sceenwidth is "+str$(screen width())
do
loop
end
remend

`my code
`FLUSH VIDEO MEMORY
load object "colz.x", 7



SET OBJECT SPEED 7, 6000
SCALE OBJECT 7, 1500, 1500, 1500

texture object 7,7
position object 7, 0, -620, -200
xrotate object 7, -90
yrotate object 7, 190





sync
`end my code
make object plain 1,1280,768
make object plain 2,1280,768
make object plain 3,1280,768
make object plain 4,1280,768
make object plain 5,1280,1280
make object plain 6,1280,1280


texture object 1,6 `wall-left wall
texture object 2,2 `wall-front wall
texture object 3,2 `wall-right wall
texture object 4,5 `wall-rear wall
texture object 5,3 `sky
texture object 6,1 `floor

rem 640
position object 1,-640,0,0
position object 2,0,0,640
position object 3,640,0,0
position object 4,0,0,-640
position object 5,0,340,0
position object 6,0,-340,0


sync


for rot=1 to 6
set object ambient rot,0
set object texture rot,2,0
point object rot,0,0,0
next rot

point camera 0, 0, 0

do

`if keystate(17)=1 then position camera camera position x(0)+5*sin(camera angle y(0)),0,camera position z(0)+5*cos(camera angle y(0))
`if keystate(31)=1 then position camera camera position x(0)-5*sin(camera angle y(0)),0,camera position z(0)-5*cos(camera angle y(0))
`if keystate(32)=1 then position camera camera position x(0)+5*cos(camera angle y(0)),0,camera position z(0)-5*sin(camera angle y(0))
`if keystate(30)=1 then position camera camera position x(0)-5*cos(camera angle y(0)),0,camera position z(0)+5*sin(camera angle y(0))
position camera 0, -100, -605

rotate camera camera angle x(0)+mousemovey()/8,camera angle y(0)+mousemovex()/8,0
sync

loop
jmsdev
16
Years of Service
User Offline
Joined: 6th Jul 2010
Location:
Posted: 21st Jul 2010 19:23
upgrading the video drivers did not help

Login to post a reply

Server time is: 2026-07-25 08:13:45
Your offset time is: 2026-07-25 08:13:45